in Algorithms edited by
512 views
1 vote
1 vote

i geeting ans 1 and 2 are true but ans given only 2 is true explain it

in Algorithms edited by
512 views

1 comment

n+1!=n+1(n!) so n!=O(n+1!)
1
1

2 Answers

0 votes
0 votes
see the difference . The 3! and 4! differ by 21. as the value get large they differ by a large amount . ex 11! and 10!. so we can't say 1 well we can't say 4 also as logn> less than loglogn. in option 2. log n base 4 = logn base2 *1/2 so complexity will be same.
0 votes
0 votes

(n+1)!  = (n+1)* (n)*(n-1)*........1  =  (n+1)*(n!)   > n!

Hence   n! =  O((n+1)!) => option (1) is wrong.

log4n  = (1/2)* log2n, So we can write log2n as follows:

(1/2)* log2n  ≤ (1/2)* log2n ≤ log2n   => (1/2)* log2n  = ⊝(log2n)  => log4n = ⊝(log2n)  Hence (!!) is correct.

√logn ≥ loglogn => loglogn  = O(√logn)   => (!!!) is wrong.

Hence only (!!) is correct. Hence option (C) is correct.