Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is O(log* N)?

What is O(log* N) and how is it different from O(log N)?

like image 220
Timmy Avatar asked Mar 05 '10 15:03

Timmy


People also ask

What is O log of n?

O(log N) basically means time goes up linearly while the n goes up exponentially. So if it takes 1 second to compute 10 elements, it will take 2 seconds to compute 100 elements, 3 seconds to compute 1000 elements, and so on. ​It is O(log n) when we do divide and conquer type of algorithms e.g binary search.

What is O logn time complexity?

4) O(Logn) Time Complexity of a loop is considered as O(Logn) if the loop variables are divided/multiplied by a constant amount. And also for recursive call in recursive function the Time Complexity is considered as O(Logn).

Is binary search O log n?

The complexity of lookup or find in a balanced binary search tree is O(log(n)). For a binary search tree in general, it is O(n).


1 Answers

O( log* N ) is "iterated logarithm":

In computer science, the iterated logarithm of n, written log* n (usually read "log star"), is the number of times the logarithm function must be iteratively applied before the result is less than or equal to 1.

like image 143
Larry Avatar answered Sep 20 '22 23:09

Larry