GATE CSE 2025 Session 1 Q35: Height of a min-heap with 32 keys
- Programming and Data Structures
- 1 mark
- NAT
- No negative marking
Question
The height of any rooted tree is defined as the maximum number of edges in the path from the root node to any leaf node.
Suppose a Min-Heap stores 32 keys. The height of is _____________. (Answer in integer)
Try it: numerical answer: type the value
Numerical answer. No negative marking.
Show answer and explanation
Answer: 5 (official GATE 2025 final answer key)
Concept used: A heap is a complete binary tree, so its height is .
First step: Levels 0 to 4 hold keys, so the 32nd key starts a new level.
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 2025 Session 1 CS question paper and final answer key, organised by IIT Roorkee. 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 · Q40Third insertion that can never yield a complete BST of 1..15