Skip to content
Related Articles

Related Articles

Improve Article
GATE | GATE CS 2021 | Set 1 | Question 20
  • Last Updated : 24 May, 2021

A binary search tree T contains n distinct elements. What is the time complexity of picking an element in T that is smaller than the maximum element in T?
(A) Θ(nlogn)
(B) Θ(n)
(C) Θ(logn)
(D) Θ(1)


Answer: (D)

Explanation: Pick any two element from the root, and return minimum of these two.

So, time is Θ(1).

Quiz of this Question

Attention reader! Don’t stop learning now. Learn all GATE CS concepts with Free Live Classes on our youtube channel.

My Personal Notes arrow_drop_up
Recommended Articles
Page :