Question 4248 – Data-Interpretation
May 4, 2024Question 10613 – Theory-of-Computation
May 4, 2024Question 11621 – Asymptotic-Complexity
Consider the following two functions:
g1(n) = {n3 for 0≤n<10,000 n2 for n≥10,000 g2(n) = {n for 0≤n<100 n3 for n≥100
Which of the following is true?
Correct Answer: A
Question 10 Explanation:
Whenever we go for asymptotic complexity, we look for large value of n. So in the given question, for large value of n like n>=10000, g1(n)=n2 and g2(n)=n3. So clearly g1(n) is O(g2(n)).
g1(n) is O(g2(n))
g1(n) is 0(n3)
g2(n) is 0 (g1(n))
g2(n) is 0(n)
Subscribe
Login
0 Comments