GATEverse
← GATE CSE 2026 Set 2

Q39

MSQ2 marks

Consider a binary search tree (BST) with nn leaf nodes (n>0)(n>0). Given any node VV, the key present in the node is denoted as Val⁡(V)\operatorname{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)\operatorname{Suc}(V) denote the node that is its inorder successor. If a node VV does not have an inorder successor, then Suc⁡(V)\operatorname{Suc}(V) is NULLN U L L. As there are no duplicates, if Suc⁡(V)\operatorname{Suc}(V) is not NULLN U L L, then Val⁡(V)<Val⁡(Suc⁡(V))\operatorname{Val}(V)<\operatorname{Val}(\operatorname{Suc}(V)). Corresponding to every leaf node LiL_{i} that has a non-NULL Suc⁡(Li)\operatorname{Suc}\left(L_{i}\right), a new key kik_{i} with the following property is to be inserted into the BST.

Val⁡(Li)<ki<Val(Suc⁡(Li))\operatorname{Val}\left(L_{i}\right) < k_{i} < Val (\operatorname{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?

Sign in to save attempts.

Loading…