pa1geek
pa1geek

Reputation: 268

Rank these time complexities

Can someone please help me rank these time complexities ?

functions with same order have to be given same rank.

Take n > 1

rank => functions :
1 => n log_2(n) , 10n log_10(n)
2 => n^(log_2log_2(n))
3 => n^2
4 => n^3
5 => 2^(log_50(n))
6 => n!
7 => (n + 1)!

The above is how I have ranked. Can any one correct it if I have made a mistake ? Also if there is any website to visualize these functions, it would be great.

Upvotes: 2

Views: 1020

Answers (1)

waTeim
waTeim

Reputation: 9225

n^(log_2log_2(n)) is going to grow faster than n raised any constant eventually so it comes after n^2 and n^3

there's a relation between all logarithms log_c1(x) = log_c2(x)/log_c2(c1) so 2^(log_50(n)) will be equal to 2^(log_2(n)/log_2(50)) 2^log_2(n) = n, so that comes before n^2.

Upvotes: 2

Related Questions