Practice mode Data Structures

Which description defines a complete binary tree?

Correct answer B. Every level is completely filled except possibly the last, which is filled from left to right

Explanation

A complete binary tree may have a partial last level, but its nodes must be packed to the left. This shape is what lets a binary heap live in an array without gaps. Having 0 or 2 children defines a full tree, and all leaves at one depth with every internal node having two children defines a perfect tree.

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.