GATE CS 2025 Set 2 | Question 35

Programming & Data Structures › Trees · NAT · 1 mark · Answer: 4

  1. Question 35Programming & Data Structuresnat1 mark
    Suppose the values 10, -4, 15, 30, 20, 5, 60, 19 are inserted in that order into an initially empty binary search tree . The number of edges in the path from the node containing 19 to the root node of is ___________. (Answer in integer)

    Answer: 4

    Solution

    Answer: 4 Insertion builds:
    10 root; -4 left of 10; 15 right of 10; 30 right of 15;
    20 left of 30; 5 right of -4; 60 right of 30; 19 left of 20.
    Path from 19 up to root: = 4 edges.

More GATE PYQ on Trees

All GATE CS Programming & Data Structures PYQ →

Attempt GATE CS 2025 Set 2 in real GATE exam mode

Full paper with a timer, the GATE interface and a topic-wise analysis — free.

Create free account →