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)
Official answer and solution
- Official answer
- 5
- From
- Official GATE 2025 answer key
Solution
Use the height formula for a complete binary tree with nodes.
A binary Min-Heap with keys is stored as a complete binary tree of nodes. The height (maximum number of edges from the root to a leaf) of a complete binary tree with nodes is:
5
Counting the number of levels (6) instead of the number of edges (5).
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2025 Computer Science and Information Technology - Session 1 (CS1)
- Question
- 35 of 65
- Section
- Computer Science and Information Technology
Report an error in this question
GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.