GATE CS 2015, set 1 · Question 35 · Programming and Data Structures · Multiple choice (MCQ) · 1 mark · −1/3 for a wrong answer

What are the worst-case complexities of insertion and deletion of a key in a binary search tree?

  1. (A) θ(log n) for both insertion and deletion
  2. (B) θ(n) for both insertion and deletion
  3. (C) θ(n) for insertion and θ(log n) for deletion
  4. (D) θ(log n) for insertion and θ(n) for deletion
Answer

Answer (B)

Answer from the official GATE CS 2015 answer key.

The step-by-step solution, where available, is part of GATE CS Pro. See what Pro includes