GATE CS 2020 · Asymptotic Analysis & Recurrences

MCQ · 2 marks · Problem PROG-DIVC-0175

In a balanced binary search tree with n elements, what is the worst case time complexity of reporting all elements in range [a,b]? Assume that the number of reported elements is k.
  1. A
    \(\Theta (\log n )\)
  2. B
    \(\Theta (\log n +k)\)
  3. C
    \(\Theta (k \log n )\)
  4. D
    \(\Theta (n \log k )\)

Solve it on GATE DA practice →More Searching & Sorting Algorithms problems

Show the worked solutionOfficial GATE Answer Key: Option B.See full step-by-step discussion on GateOverflow: https://gateoverflow.in/333190/gate2020-cs-41

GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com