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
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.
Answer checked How we write and check questions
Discussion