Tree Data Structures questions

Q23

GATE CS 2026 CS-1Tree Data StructuresMSQ1 mark
Let nn be an odd number greater than 100. Consider a binary minheap with nn elements stored in an array PP whose index starts from 1.

Which of the following indices of PP do/does NOT correspond to any leaf node of the minheap?
More than one option can be correct.
Show answer without attempting

Answer: B, C

Q33

GATE CS 2026 CS-1Tree Data StructuresNAT1 mark
The height of a binary tree is the number of edges in the longest path from the root to a leaf in the tree. The maximum possible height of a full binary tree with 23 nodes is _________. (answer in integer)
Show answer without attempting

Answer: 11

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

Q12

GATE CS 2026 CS-2Tree Data StructuresMCQ1 mark−1/3 if wrong
The set T represents various traversals over binary tree. The set S represents the order of visiting nodes during a traversal.

| T | S |
|---|---|
| I: Inorder | L: left subtree, node, right subtree |
| II: Preorder | M: node, left subtree, right subtree |
| III: Postorder | N: left subtree, right subtree, node |

Which one of the following is the correct match from T to S ?
Show answer without attempting

Answer: A

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/60 correct0 marks

Related topics in Programming and Data Structures