Question:

The height of a binary tree with 31 nodes (assuming no single-child nodes) is _______.

Show Hint

In a complete binary tree, the height can be approximated by \( \log_2(n+1) \).
Updated On: Jun 16, 2025
  • 4
  • 5
  • 6
  • 7
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is A

Solution and Explanation

A complete binary tree with 31 nodes will have a height of 4. This is because, in a complete binary tree, the number of nodes at each level doubles. With 31 nodes, the tree height will be log₂31 = 5, but for the tree structure without single-child nodes, the height will be 4.
Was this answer helpful?
0
0