Sunday, October 12, 2025
HomeData Modelling & AIAlgorithms | Analysis of Algorithms | Question 13

Algorithms | Analysis of Algorithms | Question 13

Consider the following functions:

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

Which of the following statements about the asymptotic behavior 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 the 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

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

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

Quiz of this Question
Please comment below if you find anything wrong in the above post

Whether you’re preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, neveropen Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we’ve already empowered, and we’re here to do the same for you. Don’t miss out – check it out now!
RELATED ARTICLES

Most Popular

Dominic
32352 POSTS0 COMMENTS
Milvus
87 POSTS0 COMMENTS
Nango Kala
6720 POSTS0 COMMENTS
Nicole Veronica
11885 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11942 POSTS0 COMMENTS
Shaida Kate Naidoo
6841 POSTS0 COMMENTS
Ted Musemwa
7105 POSTS0 COMMENTS
Thapelo Manthata
6797 POSTS0 COMMENTS
Umr Jansen
6795 POSTS0 COMMENTS