GATE CS 2020 · Question 51 · Programming and Data Structures · Multiple choice (MCQ) · 2 marks · −2/3 for a wrong answer
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.
- (A) Θ(log n)
- (B) Θ(log n + k)
- (C) Θ(k log n)
- (D) Θ(n log k)
Answer
Answer (B)
Answer from the official GATE CS 2020 answer key.
The step-by-step solution, where available, is part of GATE CS Pro. See what Pro includes