Question discussion

What is the height (number of edges on the longest root-to-leaf path) of a complete binary tree having 1000 nodes?

1787Medium DSSSB TGT Computer Science 0 replies 1 views
0

What is the height (number of edges on the longest root-to-leaf path) of a complete binary tree having 1000 nodes?

  • A9
  • B8
  • C10
  • D999
Correct answer: A

Explanation

The height of a complete binary tree with n nodes is ⌊log₂ n⌋ = ⌊log₂ 1000⌋ = 9, because 2⁹ = 512 ≤ 1000 < 1024.

Discussion 0

Nobody has replied yet. Start the discussion!