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 \(n\) elements, what is the worst-case time complexity of reporting all elements in the 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)\)

Attempted by 639 students.

Show answer

Correct answer: B

The worked solution is available to enrolled students.

Explore the full course: Iocl Engineers Officers Grade A Paper 2

Loading lesson…