Search code examples
big-ocomplexity-theory

Big-O Asymptotic growth rate ordering functions


This is what I have ordered the functions in increasing order of asymptotic growth rates. Also, I have simplified some functions by applying logarithmic rules.

  1. log( log n )
  2. sqrt( log n )
  3. log n^3 (which is equal to log n)
  4. n^2/3
  5. 2^logn (which is equal to n)
  6. n log n
  7. n^2

Is this order correct? Or am I missing something?


Solution

  • O( A(n) ) < O( B(n) ) holds iff A(n) / B(n) approaches 0 when n goes to infinity.

    You can check your table here: https://www.wolframalpha.com/input/?i=limit+log%28log%28n%29%29+%2F+sqrt%28log%28n%29%29%2C+n+to+infinity

    For example

    log(log(n)) / sqrt(log(n)) -> 0 for n -> inf
    

    Hence O(log(log(n)) < O(sqrt(log(n)).