Binary Search Trees questions

Q40

GATE CS 2026 CS-1Tree Data StructuresMCQ2 marks−2/3 if wrong
Let PP be the set of all integers from 1 to 15. Consider any order of insertion of the elements of PP into a binary search tree that creates a complete binary tree.

Which one of the following elements can NEVER be the third element that is inserted?
Show answer without attempting

Answer: D

Q62

GATE CS 2026 CS-1Tree Data StructuresNAT2 marks
The following sequence corresponds to the preorder traversal of a binary search tree TT:

50, 25, 13, 40, 30, 47, 75, 60, 70, 80, 77

The position of the element 60 in the postorder traversal of TT is ______. (answer in integer)

Note: The position begins with 1.
Show answer without attempting

Answer: 7

Q49

GATE CS 2026 CS-2Tree Data StructuresMSQ2 marks
Consider a binary search tree (BST) with nn leaf nodes (n>0n > 0). Given any node VV, the key present in the node is denoted as Val(V)Val(V). All the keys present in the given BST are distinct. The keys belong to the set of real numbers.

For a node VV, let Suc(V)Suc(V) denote the node that is its inorder successor. If a node VV does not have an inorder successor, then Suc(V)Suc(V) is NULLNULL. As there are no duplicates, if Suc(V)Suc(V) is not NULLNULL, then Val(V)<Val(Suc(V))Val(V) < Val(Suc(V)).

Corresponding to every leaf node LiL_i that has a non-NULLNULL Suc(Li)Suc(L_i), a new key kik_i with the following property is to be inserted into the BST.

Val(Li)<ki<Val(Suc(Li))Val(L_i) < k_i < Val(Suc(L_i))

Let KK represent the list of all such new keys to be inserted into the BST.

Which of the following statements is/are true?
More than one option can be correct.
Show answer without attempting

Answer: A, C

0/30 correct0 marks

Related topics in Tree Data Structures