What is the height of a binary tree with 7 nodes ?
2025
What is the height of a binary tree with 7 nodes ?
- A.
3
- B.
4
- C.
2
- D.
7
Attempted by 132 students.
Show answer & explanation
Correct answer: C
In advanced textbooks (like CLRS), the height of a tree is defined as the number of edges on the longest downward path from the root to a leaf.
A single-node tree has a height of 0 (since there are no edges).
In a full, balanced binary tree with 7 nodes, the path from the root to any leaf node crosses exactly 2 edges.
Under this definition, the minimum height is 2 (Option 3).