Computer Sciences > GATE 2026 SET-2 > Data Structures
Consider a binary search tree (BST) with 𝑛 leaf nodes (𝑛>0). Given any node 𝑉, the key present in the node is denoted as π‘‰π‘Žπ‘™(𝑉). All the keys present in the given BST are distinct. The keys belong to the set of real numbers. For a node 𝑉, let 𝑆𝑒𝑐(𝑉) denote the node that is its inorder successor. If a node 𝑉 does not have an inorder successor, then 𝑆𝑒𝑐(𝑉) is π‘π‘ˆπΏπΏ. As there are no duplicates, if 𝑆𝑒𝑐(𝑉) is not π‘π‘ˆπΏπΏ, then π‘‰π‘Žπ‘™(𝑉) <π‘‰π‘Žπ‘™(𝑆𝑒𝑐(𝑉)).
Corresponding to every leaf node 𝐿𝑖 that has a non-NULL 𝑆𝑒𝑐(𝐿𝑖), a new key π‘˜π‘– with the following property is to be inserted into the BST.
Vπ‘Žπ‘™(𝐿𝑖)< π‘˜π‘–< π‘‰π‘Žπ‘™(𝑆𝑒𝑐(𝐿𝑖))
Let 𝐾 represent the list of all such new keys to be inserted into the BST. Which of the following statements is/are true?
A
K cannot have any duplicates
B
K will have at least one element
C
After inserting all keys from K, the height of the BST can increase at most by one
D
Number of nodes in the BST will double after inserting all keys from K

Correct : a,b,c

Each new key ki satisfies Val(Li) < ki < Val(Suc(Li)), inserted for every leaf that has a non-NULL inorder successor.
Option A β€” True
In a BST the inorder sequence is strictly sorted and all keys are distinct. The interval (Val(Li), Val(Suc(Li))) for each leaf is completely disjoint from every other leaf's interval β€” no two leaves share the same consecutive inorder pair. Since all intervals are non-overlapping, it is impossible for two different ki values chosen from different intervals to be equal. K cannot have duplicates. A is true.
Option B β€” True
Any BST with more than one node always has at least one leaf that is not the rightmost node, meaning at least one leaf has a non-NULL inorder successor. So K always has at least one element. B is true.
Option C β€” True
Since ki > Val(Li) and Li is a leaf with no right child, every new key inserts as a direct right child of Li, exactly one level below an existing leaf. Height increases by at most 1. C is true.
Option D β€” False
The rightmost leaf has no inorder successor and contributes nothing to K. So new nodes inserted are strictly less than n, and total nodes cannot reach 2n. Doubling is impossible. D is false.
Correct answer: A, B, C

Similar Questions

Which one of the following sequences when stored in an array at locations A[1],...,A[10] forms a max-heap?
#950 MCQ
Let SLLdel be a function that deletes a node in a singly-linked list given a pointer to the node and a pointer to the head of the list. Similarly, let DLLdel be...
#951 MCQ
An algorithm has to store several keys generated by an adversary in a hash table. The adversary is malicious who tries to maximize the number of collisions. Let...
#957 MCQ

Related Topics

BST inorder successor GATE 2026 GATE CS 2026 Set-2 Q49 binary search tree leaf node key insertion BST height increase at most one inorder successor new key BST data structures GATE 2026 BST leaf successor insertion GATE computer science BST 2026

Unique Visitor Count

Total Unique Visitors

Loading......