big-o
O-notation, O(∞) = O(1)?
So a quick thought; Could one argue that O(∞) is actually O(1)? I mean it isn\'t depend on input size?[详细]
2023-02-23 13:31 分类:问答Big O Notation for with n^3 Nested For loops
Considering the following code: for ( int j = 0; j < 2n; j++) { for ( int k = 0; k < n^3; k += 3) sum++;[详细]
2023-02-22 01:50 分类:问答Does HashSet.equals() run in constant time?
Just wondering if HashSet.equals(anotherHashSet) runs in constant time (also with a ConcurrentHashSet as argument), which I\'m assuming it does for efficiency reasons. Can\'t see anything which mentio[详细]
2023-02-21 23:39 分类:问答What is the order of the run time for an algorithm with this desired output?
There are N sets Ai to An each with string entries开发者_StackOverflow中文版. The average size of a set is K.[详细]
2023-02-21 20:41 分类:问答How can I calculate the Big O complexity of my program?
I have a Big O notation question. Say I have a Java program that does the following things: Read an Array of Integers into a HashMap that keeps track of how many occurrences of the Integers exists i[详细]
2023-02-21 18:44 分类:问答which algorithm can do a stable in-place binary partition with only O(N) moves?
I\'m trying to understand this paper: Stable minimum space partitioning in linear time. It seems that a critical part of the claim is that[详细]
2023-02-20 14:50 分类:问答Copy a string in constant time?
I\'ve seen the operation of copying a string describ开发者_如何学JAVAed as O(n), where n is the length of the string, because it\'s assumed that we need to iterate through each character of the string[详细]
2023-02-20 08:32 分类:问答I need help for Calculating "Big O"
the first problem; sum = 0; for i = 1 to n; i++ { for j = 1 to i * i; j++ { for k = 1 to j; k++ sum ++; } }[详细]
2023-02-20 02:05 分类:问答How efficient is Python's max function
The function max() which returns the maximum element from a list . . . what is its running time开发者_运维问答 (in Python 3) in terms of Big O notation?It\'s O(n), since it must check every element.If[详细]
2023-02-19 23:24 分类:问答Finding the minimum in an unsorted array in logarithmic time
Is there an algorithmic approach to find the minimum of an unsorted array in logarithmic time ( O(logn) )? Or is it only possible in linear time? I don\'t want to go parallel.[详细]
2023-02-19 18:11 分类:问答
加载中,请稍侯......