Let f(n) and g(n) be asymptotically non-negative functions. Which of the following is correct?
(A)
θ ( f (n)*g(n)) = min (f (n), g(n))
(B)
θ ( f (n)*g(n)) = max (f (n), g(n))
(C)
θ( f (n) + g(n)) = min (f (n), g(n))
(D)
θ ( f (n) + g(n)) = max (f (n), g(n))
Answer: (D)
Explanation:
- Case-1: When none of the f(n) and g(n) are constant functions – In this case max(f(n) , g(n)) <= f(n) * g(n) so max(f(n), g(n)) can not provide a upper bound for f(n) * g(n).
- Case-2: When both of the f(n) & g(n) are constant functions or when any one of the f(n) and g(n) is a non zero constant function, In this case f(n) * g(n) = theta(max(f(n), g(n))).
- Case-3: When at least any one of the f(n) and g(n) is 0, In this case f(n) * g(n) != theta(max(f(n), g(n))). Since max(f(n), g(n)) COULD BE unable to give a lower bound.
Option (D) is correct.
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,
GeeksforGeeks 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!
Last Updated :
11 Sep, 2019
Like Article
Save Article