All mock tests are FREE till 31 December — register to save your progress
Unit 7 · Data Structures and Algorithms Paper 2 CS · 22 June 2026

If f(n) = θ(g(n)) and g(n) = O(h(n)), then which of the following is true?

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: A. f(n) = O(h(n))

Explanation

f(n) = θ(g(n)) means f(n) is both O(g(n)) and Ω(g(n)); in particular f(n) = O(g(n)). Combined with the given g(n) = O(h(n)), the transitivity of O-notation gives f(n) = O(g(n)) = O(h(n)), so f(n) = O(h(n)). Only an upper bound relating g and h is given, with no information about a matching lower bound, so none of f(n)=θ(h(n)), h(n)=O(f(n)) or h(n)=θ(f(n)) can be concluded in general. Hence the statement guaranteed to be true is f(n) = O(h(n)).

More Data Structures and Algorithms questions