GATE | GATE CS 2008 | Question 39

Consider the following functions:

f(n) = 2n
g(n) = n!
h(n) = nlogn

Which of the following statements about the asymptotic behaviour of f(n), g(n), and h(n) is true?

(A) f(n) = O(g(n)); g(n) = O(h(n))
(B) f(n) = \Omega(g(n)); g(n) = O(h(n))
(C) g(n) = O(f(n)); h(n) = O(f(n))
(D) h(n) = O(f(n)); g(n) = \Omega(f(n)) 

(A) A
(B) B
(C) C
(D) D


Answer: (D)

Explanation: According to order of growth: h(n) < f(n) < g(n) (g(n) is asymptotically greater than f(n) and f(n) is asymptotically greater than h(n) )
We can easily see above order by taking logs of the given 3 functions

   lognlogn < n < log(n!)  (logs of the given f(n), g(n) and h(n)).

Note that log(n!) = \theta(nlogn)

Quiz of this Question

My Personal Notes arrow_drop_up
Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.