The maximum height of a binary tree with ‘n’ nodes is ______.
2020
The maximum height of a binary tree with ‘n’ nodes is ______.
- A.
(n + n)
- B.
(n + 1)
- C.
n
- D.
(n − 1)
Attempted by 470 students.
Show answer & explanation
Correct answer: D
The correct answer depends on the height definition used. If height is the number of edges on the longest path, the maximum height of a skewed binary tree with n nodes is (n - 1). If height is measured by nodes (levels), it is n. Based on Option D being marked correct, this platform defines height by edges, making Option D the intended correct choice, despite the conflicting feedback text in Option C.