###### Question 10562 – Time-Complexity

February 13, 2024###### Question 9704 – Time-Complexity

February 13, 2024# Question 9848 – Time-Complexity

Consider the following functions

Which of the following is true?

Correct Answer: D

Question 13 Explanation:

Consider n value as 2

Then

f(n) = 3(n

g(n) = 2

h(n) = 1024!

So relation between the functions can be:

f(n) and g(n) are of same order, so f(n) is O(g(n)) and g(n) = O(f(n)). Option C is wrong.

h(n) is n! Which is of higher order than f(n) and g(n). So options A and B are wrong.

^{10}Then

f(n) = 3(n

^{32}) = 3*(2^{10})^{32}= 3*2^{320}g(n) = 2

^{320}h(n) = 1024!

So relation between the functions can be:

f(n) and g(n) are of same order, so f(n) is O(g(n)) and g(n) = O(f(n)). Option C is wrong.

h(n) is n! Which is of higher order than f(n) and g(n). So options A and B are wrong.

h(n) is O (f(n))

h(n) is O (g(n))

g(n) is not O (f(n))

f(n) is O(g(n))

Subscribe

Login

0 Comments