About 3,490 results
Open links in new tab
  1. algorithms - Is O(log n) - Software Engineering Stack Exchange

    No, O(log n) + O(log n) is not O(n). It is still O(log n). When we have a big-O formula multiplied by a constant, it is equivalent to the value without the multiplied constant. So: O(k * g) = O(g) where k is a constant, non-zero factor and g is a bounding function.

  2. complexity - Determining if an Algorithm is O (log n) - Software ...

    Aug 24, 2015 · The typical examples are ones that deal with binary search. For example, a binary search algorithm is usually O(log n). If you have a binary search tree, lookup, insert and delete are all O(log n) complexity. Any situation where you continually partition the space will often involve a log n component.

  3. Is this a sorting algorithm faster than O(n*log(n))

    Dec 19, 2018 · Congratulations, you have re-invented counting sort! (I'm not being sarcastic, things independently being re-invented multiple times is a good thing, it shows that it is a natural and good way to solve problems.)

  4. Is O (log n) for memory management considered slow?

    Sep 21, 2017 · Thus, any O(log n) algorithm is going to be marked as "too slow" by the general populous unless it offers some valuable feature to offset this speed change. You won't sell many sports cars with 50HP motors in them in a country where sportcars all have 250+HP, unless you can show some unique value of this 50HP sportscar.

  5. Why is mergesort O (log n)? - Software Engineering Stack Exchange

    Sep 14, 2015 · The complexity of merge sort is O(nlog(n)) and NOT O(log(n)). Merge sort is a divide and conquer algorithm. Think of it in terms of 3 steps: The divide step computes the midpoint of each of the sub-arrays. Each of this step just takes O(1) time. The conquer step recursively sorts two subarrays of n/2 (for even n) elements each.

  6. When speaking, how can I say that the time complexity order of an ...

    Jul 18, 2015 · Stack Exchange Network. Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

  7. Algorithms: How do I sum O(n) and O(nlog(n)) together?

    The big O notation is defined as a set: So contains all functions that are - starting from some arbitrary large point - always smaller than g.

  8. Merge sort and O (n log n) mystery - Software Engineering Stack …

    Feb 18, 2016 · The complexity of merge sort is O(nlogn) and NOT O(n*n). Merge sort is a divide and conquer algorithm. Think of it in terms of 3 steps -

  9. What is O (m+n) and O (m*n) in Big O notation? [duplicate]

    Sep 8, 2015 · That depends on the context, but typically, m and n are the sizes of two separate parts of the dataset, or two separate properties of the dataset, for example, filling a m×n array.

  10. How meaningful is the Big-O time complexity of an algorithm?

    Often times there will be a trade-off between time and space: for example quicksort requires O(log n) extra memory while heapsort can use O(1) extra memory, however the hidden constants in heapsort makes it less attractive (there's also the stability issue which make mergesort more attractive if you don't mind payign the extra memory costs).

Refresh