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
- The number of leaf nodes in a full 4-ary rooted tree of n nodes is
- Which of the following statements maybe false for a decision problem X ∈ NP?
- A binary search tree is obtained by inserting the words "Mathematics", "Physics", "Geography", "Zoology", "Metrology", "Geology", "Psycholo…
- In open addressing, how are collisions typically resolved?
- What is the height of the binary search tree obtained by inserting the numbers 40, 60, 50, 37, 52, 15, 8, 22 in the given order
- Match the LIST-I with LIST-II. LIST-I (Data structure) LIST-II (Characteristics) A. Stack I. First-In-First-Out (FIFO) order B. Queue II. L…