Search code examples
algorithmcomplexity-theoryasymptotic-complexitybig-o

Algorithm complexity, log^k n vs n log n


I am developing some algorithm with takes up O(log^3 n). (NOTE: Take O as Big Theta, though Big O would be fine too)

I am unsure whereas O(log^3 n), or even O(log^2 n), is considered to be more/less/equaly complex as O(n log n).

If I were to follow the rules stright away, I'd say O(n log n) is the more complex one, but still, I don't have any clue as why or how.

I've done some research but I haven't been able to find an answer to this question.

Thank you very much.


Solution

  • Thus (n log n) is "bigger" than ((log n)3). This could be easily generalized to ((log n)k) via induction.