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 : 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

No tags found

Unique Visitor Count

Total Unique Visitors

Loading......