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\).
- A.
\(\Theta (\log n)\) - B.
\(\Theta (\log n +k)\) - C.
\(\Theta (k \log n)\) - D.
\(\Theta ( n \log k)\)
Attempted by 639 students.
Show answer
Correct answer: B
Explore the full course: Iocl Engineers Officers Grade A Paper 2
Loading lesson…