Data Structures & AlgorithmsVery hardGATE CS · TCS NQT
A recurrence T(n) = 7·T(n/4) + n^1 with constant base case. By the master theorem, which tight bound describes T(n)?
- A. Θ(n^(log_4 7))
- B. Θ(n log n)
- C. Θ(n^2)
- D. Θ(n)
Correct answer: A. Θ(n^(log_4 7))
Compare a = 7 with b^k = 4^1 = 4: a is larger, so the solution is Θ(n^(log_4 7)). Using the wrong case of the master theorem gives one of the other options.
Practise more Trees, Graphs, Recursion and Dynamic Programming questionsTrees, Graphs, Recursion and Dynamic Programming: notes and key points
More Trees, Graphs, Recursion and Dynamic Programming questions
- A recurrence T(n) = 4·T(n/3) + n^1 with constant base case. By the master theorem, which tight bound describes T(n)?
- A recurrence T(n) = 3·T(n/3) + n^2 with constant base case. By the master theorem, which tight bound describes T(n)?
- A recurrence T(n) = 6·T(n/3) + n^1 with constant base case. By the master theorem, which tight bound describes T(n)?
- A binary tree has distinct letters as node labels. Its preorder traversal (root, left, right) is B A F E C D and its inorder traversal…
- A binary tree has distinct letters as node labels. Its preorder traversal (root, left, right) is G C A H F D B E and its inorder traversal…
- A binary tree has distinct letters as node labels. Its preorder traversal (root, left, right) is D E F B C A and its inorder traversal…