Skip to content
Related Articles
Open in App
Not now

Related Articles

GATE | GATE-CS-2015 (Set 1) | Question 33

Improve Article
Save Article
Like Article
  • Difficulty Level : Easy
  • Last Updated : 28 Jun, 2021
Improve Article
Save Article
Like Article

What are the worst-case complexities of insertion and deletion of a key in a binary search tree?
(A) Θ(logn) for both insertion and deletion
(B) Θ(n) for both insertion and deletion
(C) Θ(n) for insertion and Θ(logn) for deletion
(D) Θ(logn) for insertion and Θ(n) for deletion


Answer: (B)

Explanation: The time taken by search, insert and delete on a BST is always proportional to height of BST. Height may become O(n) in worst case.

Quiz of this Question

My Personal Notes arrow_drop_up
Like Article
Save Article
Related Articles

Start Your Coding Journey Now!