GATE CSE 2026 Session 1 Q40: Third insertion that can never yield a complete BST of 1..15
- Programming and Data Structures
- 2 marks
- MCQ
- −2/3 if wrong
Question
Let be the set of all integers from 1 to 15. Consider any order of insertion of the elements of 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?
Try it: multiple choice: exactly one correct option
Show answer and explanation
Answer: D (official GATE 2026 final answer key)
Concept used: A node can be inserted only after all its ancestors in the final tree.
First step: Draw the complete BST (root 8, then 4 and 12, then 2, 6, 10, 14) and count the ancestors of each option.
Full step-by-step solution
Detailed working, common mistakes and linked mock tests will be available with a free GATEiit account. Log-in is coming soon.
Share this question
Source: official GATE 2026 Session 1 CS question paper and final answer key, organised by IIT Guwahati. Question paper · Answer key
More Programming and Data Structures PYQs
- 2026 Session 1 · Q23Non-leaf indices in a 1-indexed binary heap with n odd
- 2026 Session 1 · Q24Empty slots after linear-probing inserts with h(x) = (x+7) mod 11
- 2026 Session 1 · Q33Maximum height of a full binary tree with 23 nodes
- 2026 Session 1 · Q34Output of a C function with a shadowed block variable
- 2026 Session 1 · Q39Recursive length of a non-empty singly linked list
- 2026 Session 1 · Q61Smallest n for which foo(n) = 5 with foo(bar(n))