Rank the following functions in nondecreasing order based o
Rank the following functions in non-decreasing order (?) based on their tight big-Oh complexities and justify your ranking:
3+ logr,loglogn,ym, n!,n, (2),2\",nlogn,n\",2 ,2\',22 n3 + logn, loglogn, Vn, n!, C ) , 2, nlogn, n\", 2log n , 2n 22 n2Solution
Answer:
2^n! > n^n > 2^n! > 2^2n > = 2^n > n! > n^3 + logn > n^1/2 >2^logn> n/2 > loglogn
This order can be checked by taking too functions like :
2^n 2^logn
Now taking log on both sides , we get
log( 2^n) log (2^logn)
nlog2 logn * log2
Now take higher values of n
n = 128
128 * 2 = log(128) * 1
256 = 7
Thus 2^n > 2^logn , by this method we can check all the functions one by one.
