Practice mode Data Structures

In a binary tree where the root is at level 0, what is the maximum number of nodes at level 4?

Correct answer A. 16

Explanation

Each node has at most two children, so the maximum doubles at every level: 1, 2, 4, 8, 16. Level l can therefore hold at most 2^l nodes, giving 2^4 = 16 at level 4. The value 31 is the maximum total for levels 0 to 4 combined, and 15 is the total for levels 0 to 3, both easily confused with the per-level count.

Report a problem

Answer checked How we write and check questions

Tip: press A, B, C or D to answer, and N for the next question.

Advertisement

Have a question about this answer?

Your email address will not be published. Required fields are marked *

Links and website addresses are not allowed in comments.