Skip to interview prep
Apexed

23. Define full, complete and perfect binary trees.

EasyTrees

Technical
Show model answer

Full (strict): every node has 0 or 2 children. Complete: every level is filled except possibly the last, which is filled from the left (this is the shape of a binary heap). Perfect: every internal node has 2 children and all leaves are at the same depth, so it has 2^(h+1) − 1 nodes.

Define full, complete and perfect binary trees. — Data structures & algorithms interview question — Apexed