GateAI
Binary Search Trees

GATE CSE 2015 Set 1 · Q23

MCQ1 markEasy

Time

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

Select one answerSingle correct

Pick an option to check

Solution

Step-by-step verified solution

Official answer: B) (n) for both insertion and deletion

Binary Search Trees

In a standard (unbalanced) Binary Search Tree (BST) with nn nodes, the time complexity of search, insertion, and deletion operations is proportional to the height of the tree, hh.

In the worst case, the BST becomes skewed (a degenerate tree where each node has at most one child). In this case, the height of the tree is:

h=n−1h = n - 1

Therefore:

  • Insertion: Traversing to the correct leaf position in a skewed tree takes θ(n)\theta(n) time.

  • Deletion: Searching for the node to delete and/or finding its inorder successor/predecessor takes θ(n)\theta(n) time.

Thus, the worst-case time complexity is θ(n)\theta(n) for both insertion and deletion, which corresponds to option (B).

Try the question first, then check your work.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

This Binary Search Trees previous year question is Q23 of the GATE CSE 2015 Set 1 paper. Find more GATE CSE PYQs on Binary Search Trees in Programming and Data Structures, or browse all GATE CSE PYQs.

Free diagnostic

Where do you stand for GATE?

Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related Binary Search Trees PYQs now with no account.

One GATE CSE PYQ every morning

An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.

Binary Search Trees in GATE CSE

Binary Search Trees has 21 GATE CSE PYQs across 17 papers from 2011 to 2026. 8 of them are 1-mark MCQs like this one, and GATE CSE 2015 Set 1 has 2.

How GATE tests Binary Search Trees

More from GATE CSE 2015 Set 1

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2015 Set 1 · Q23 · MCQ

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

Topic-wise GATE CS PYQs with verified steps

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.