Skip to content
GATEiit

GATE CSE 2025 Session 2 Q35: Depth of node 19 in a binary search tree

Question

Suppose the values 10,−4,15,30,20,5,60,1910, -4, 15, 30, 20, 5, 60, 19 are inserted in that order into an initially empty binary search tree. Let TT be the resulting binary search tree.

The number of edges in the path from the node containing 19 to the root node of TT is ___________. (Answer in integer)

Try it: numerical answer: type the value

Numerical answer. No negative marking.
Show answer and explanation

Answer: 4 (official GATE 2025 final answer key)

Concept used: BST insertion: each key goes left or right by comparison from the root.

First step: Trace 19's insertion: compare with 10, 15, 30 and 20 before it is placed.

Full step-by-step solution

Detailed working, common mistakes and linked mock tests will be available with a free GATEiit account. Log-in is coming soon.

Share this question

WhatsAppDownload image

Source: official GATE 2025 Session 2 CS question paper and final answer key, organised by IIT Roorkee. Question paper · Answer key