Binary Search Tree · Data Structures
32 questions · asked in 17 of 27 years (2000–2026)
MCQ 26 · MSQ 2 · NAT 41-mark 20 · 2-mark 12
2000Questions per year2026
Questions 11–15 of 32
The pre-order transversal of a binary search tree is given by 12, 8, 6, 2, 7, 9, 10, 16, 15, 19, 17, 20. Then the post-order traversal of this tree is:
Answer: (B)
Make the BST from the preorder: root 12. Left subtree: 8, with left child 6 (children 2, 7) and right child 9 (right child 10). Right subtree: 16, with left child 15 and right child 19 (children 17, 20).
Postorder: 2, 7, 6, 10, 9, 8, 15, 17, 20, 19, 16, 12
Answer: 2,7,6,10,9,8,15,17,20,19,16,12
Postorder: 2, 7, 6, 10, 9, 8, 15, 17, 20, 19, 16, 12
Answer: 2,7,6,10,9,8,15,17,20,19,16,12
The number of ways in which the numbers 1,2,3,4,5,6,7 can be inserted in an empty binary search tree, such that the resulting tree has height 6, is _____.
Note: The height of a tree with a single node is 0.
Note: The height of a tree with a single node is 0.
Answer: 64
A tree with 7 nodes and height 6 must be one single path.
So at every insertion, the number chosen must be either the smallest or the largest of the numbers still left. That gives 2 choices each time, and the last number has no choice.
Answer: 64
So at every insertion, the number chosen must be either the smallest or the largest of the numbers still left. That gives 2 choices each time, and the last number has no choice.
Answer: 64
Which of the following is/are correct inorder traversal sequence(s) of binary search tree(s)?
I. 3, 5, 7, 8, 15, 19, 25
II. 5, 8, 9, 12, 10, 15, 25
III. 2, 7, 10, 8, 14, 16, 20
IV. 4, 6, 7, 9, 18, 20, 25
I. 3, 5, 7, 8, 15, 19, 25
II. 5, 8, 9, 12, 10, 15, 25
III. 2, 7, 10, 8, 14, 16, 20
IV. 4, 6, 7, 9, 18, 20, 25
Answer: (A)
The in-order traversal of a BST is always in sorted order.
- I: sorted valid
- II: 12 comes before 10 not valid
- III: 10 comes before 8 not valid
- IV: sorted valid
Answer: I and IV only
- I: sorted valid
- II: 12 comes before 10 not valid
- III: 10 comes before 8 not valid
- IV: sorted valid
Answer: I and IV only
What are the worst-case complexities of insertion and deletion of a key in a binary search tree?
Answer: (B)
In the worst case a BST is skewed, so it becomes a chain with height n 1. Then both insertion and deletion may have to travel along the whole chain.
Answer: for both insertion and deletion
Answer: for both insertion and deletion
While inserting the elements 71, 65, 84, 69, 67, 83 in an empty binary search tree (BST) in the sequence shown, the element in the lowest level is
Answer: (B)
Insert each element in order:
- 71 is the root; 65 goes left, 84 goes right
- 69 goes right of 65; 67 goes left of 69 (level 3)
- 83 goes left of 84 (level 2)
The lowest element is 67.
Answer: 67
- 71 is the root; 65 goes left, 84 goes right
- 69 goes right of 65; 67 goes left of 69 (level 3)
- 83 goes left of 84 (level 2)
The lowest element is 67.
Answer: 67
Keep practising
Topics in Data Structures
ArrayStackQueueLink ListBinary Treen-ary Tree
Binary Search TreeYou are here
AVL TreeHeap TreeB TreeB plus TreeHashing