Skip to main content

Questions tagged [big-o]

The Big-O notation is used to represent asymptotic upper bounds. It describes relevant time or space complexity of algorithms. Big-O analysis provides a coarse and simplified estimate of a problem difficulty.

-2 votes
1 answer
144 views

A Hashed Array Mapped Trie has a time complexity of log32(n). According to the paper referred by this implementation, the 32 comes from the cardinality of the alphabet, which in this case is a 32 bits ...
Bharel's user avatar
  • 163
0 votes
0 answers
100 views

Wikipedia says "increase key" is O(log n) for a binary heap, but it is referring to an internal function. I'm not asking about that: Imagine the data structure had an external/public ...
Daniel Kaplan's user avatar
2 votes
7 answers
4k views

An asymptote in mathematics represents a value (line) to which the observed function constantly approaches. In other words, as the value of X increases towards infinity, i.e. decreases towards minus ...
dassd's user avatar
  • 147
3 votes
1 answer
320 views

I'm doing a running time analysis using the aggregate method and I'm a bit confused about what would be the result in this case. I have some intuition in inferring that it would be O(mlog(n)) but I'm ...
neo's user avatar
  • 51
2 votes
4 answers
517 views

I'm learning about Big O notation and how it relates to computer science and I understand the sentiment behind Big O, however I'm struggling at understanding how we define a "step". In the ...
Davis Kim's user avatar
0 votes
3 answers
792 views

Let's assume we have a method that we want to run as fast as possible and it needs to loop on a 2D array, naturally we would do a nested for loop as such: int[][] arr = new int[3][3]; for(int ...
Yoh's user avatar
  • 51
0 votes
0 answers
96 views

So I came upon this time complexity result and I was confused about it, it said that : O(nlogn) + O(logn) =O(log(n+1)) Why is that the case? Shouldn't the result be O(nlogn)?
blake 's user avatar
  • 27
0 votes
2 answers
1k views

I am trying to calculate the time complexity of the below code snippet def func() { for(i=1; i<=n; i++) { for(j=1; j<=n; j=j+i) { print("hello") } }...
learnToCode's user avatar
0 votes
2 answers
199 views

I have a program that calculates N digits of Pi. I have measured that it takes 10x time to calculate 3n numbers, compared with the time for calculating n numbers. The source code also gives an ...
15 Volts's user avatar
  • 127
3 votes
1 answer
437 views

There was a question asking what the "O" stands for in "Big O", the answer to which seems to be "Ordnung von"/"order of". I wonder what's the origin of the ...
xji's user avatar
  • 791
2 votes
1 answer
595 views

I am currently doing some exercises with algorithms and I find myself in a huge problem. It seems that everybody understands this type of problem but I have a really hard time figuring it out. For ...
Samed Škulj's user avatar
-2 votes
2 answers
302 views

Often when I'm doing an operation comparing an array to itself, I write code along these lines: function operation (array) { for (let i = 0; i < array.length; i++) { for (let j = i + 1; j <...
Robin's user avatar
  • 107
-4 votes
1 answer
429 views

Please, consider the below merge sort algorithm. Here we start with a divide portion which splits the array into halves and we do recursive operation on each half separately. I have ignored the merge ...
Brisingr's user avatar
3 votes
3 answers
3k views

Is there anything that can calculate the Big-O notation of a function? While learning about Big-O, it is implied that it is pretty trivial to do in your head once you know the basic rules, however if ...
Anon's user avatar
  • 3,649
50 votes
8 answers
11k views

I'm trying to teach myself how to calculate BigO notation for an arbitrary function. I found this function in a textbook. The book asserts that the function is O(n2). It gives an explanation as to why ...
SteveJ's user avatar
  • 636

15 30 50 per page
1
2 3 4 5
10