In a balanced binary search tree with \(n\) elements, what is the worst-case…

GATE · 2020 · CS · Computer Science & IT

In a balanced binary search tree with nn elements, what is the worst-case time complexity of reporting all elements in the range [a,b][a,b]? Assume that the number of reported elements is kk.

  1. A.

    Θ(log⁡n)\Theta (\log n)

  2. B.

    Θ(log⁡n+k)\Theta (\log n +k)

  3. C.

    Θ(klog⁡n)\Theta (k \log n)

  4. D.

    Θ(nlog⁡k)\Theta ( n \log k)

Attempted by 670 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…