Algorithms
October 12, 2023Algorithms
October 12, 2023Algorithms
Question 39

Consider the following two functions:
Which of the following is true?
g_{1}(n) is O(g_{2}(n))


g_{1} (n) is O(^{3})


g_{2} (n) is O(g_{1} (n))


g_{2} (n) is O(n)


Both A and B

Question 39 Explanation:
In asymptotic complexity, we assume sufficiently large n. So, g_{1}(n) = n^{2} and g_{2}(n) = n^{3}.
Growth rate of g_{1} is less than that of g_{2} i.e., g_{1}(n) = O(g_{2}(n)) = O(n).
Growth rate of g_{1} is less than that of g_{2} i.e., g_{1}(n) = O(g_{2}(n)) = O(n).
Correct Answer: E
Question 39 Explanation:
In asymptotic complexity, we assume sufficiently large n. So, g_{1}(n) = n^{2} and g_{2}(n) = n^{3}.
Growth rate of g_{1} is less than that of g_{2} i.e., g_{1}(n) = O(g_{2}(n)) = O(n).
Growth rate of g_{1} is less than that of g_{2} i.e., g_{1}(n) = O(g_{2}(n)) = O(n).
Subscribe
Login
0 Comments