The depth of a complete binary tree is given by:
2026
The depth of a complete binary tree is given by:
- A.
log2(n)
- B.
floor ( log2(n) )
- C.
n . log2(n) + 1
- D.
n . log2(n)
Attempted by 176 students.
Show answer & explanation
Correct answer: B
For a complete binary tree with n nodes, the depth is determined by how many levels are needed to store all nodes. Since binary trees double in capacity per level, the depth is mathematically defined as floor(log2(n)).