Consider a binary search tree (BST) with $n$ leaf nodes ( $n>0$ ). Given any node $V$, the key present in the node is denoted as $\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 $V$, let $\operatorname{Suc}(V)$ denote the node that is its inorder successor. If a node $V$ does not have an inorder successor, then $\operatorname{Suc}(V)$ is NULL. As there are no duplicates, if $\operatorname{Suc}(V)$ is not NULL, then $\operatorname{Val}(V)<\operatorname{Val}(\operatorname{Suc}(V))$.
Corresponding to every leaf node $L_i$ that has a non-NULL $\operatorname{Suc}\left(L_i\right)$, a new key $k_i$ with the following property is to be inserted into the BST.
$$ \operatorname{Val}\left(L_i\right) < k_i < \operatorname{Val}\left(\operatorname{Suc}\left(L_i\right)\right) $$
Let $K$ represent the list of all such new keys to be inserted into the BST.
Which of the following statements is/are true?
Let $P$ be the set of all integers from 1 to 15 . Consider any order of insertion of the elements of $P$ 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?
The following sequence corresponds to the preorder traversal of a binary search tree:
$$ 50,25,13,40,30,47,75,60,70,80,77 $$
The position of the element 60 in the postorder traversal of $T$ is $\_\_\_\_$ . (answer in integer)
Note: The position begins with 1.
A meld operation on two instances of a data structure combines them into one single instance of the same data structure. Consider the following data structures:
P: Unsorted doubly linked list with pointers to the head node and tail node of the list.
Q: Min-heap implemented using an array.
R: Binary Search Tree.
Which ONE of the following options gives the worst-case time complexities for meld operation on instances of size $n$ of these data structures?
GATE CSE Subjects
Browse all chapters by subject