Course contentsShow
← Computer Science
Lesson 459 of 2,87211. Binary TreesFree lesson

Full, Complete, and Perfect Binary Trees

Distinguishing between different binary tree structures based on how nodes fill each level.

Full, Complete, and Perfect Binary Trees

What you'll learn: You'll understand the three special classifications of binary trees based on how thoroughly nodes fill each level.

The Core Idea

Not all binary trees are created equal. Depending on how densely packed the nodes are, we give them different names:

Full Binary Tree

A binary tree where every node has either 0 or 2 children — no node has just one child. Think of it like a family tree where every couple either has exactly two children or no children at all; no single-child families allowed.

Complete Binary Tree

A binary tree where all levels are completely filled except possibly the last level, and the last level has nodes filled from left to right with no gaps. Imagine filling seats in a theater: you fill each row completely before moving to the next, and within the last row, you fill from left to right without skipping seats.

Perfect Binary Tree

The most restrictive type: all internal nodes have exactly two children AND all leaves are at the same level. Every level is completely filled. Think of a perfectly symmetrical pyramid where each layer is entirely complete.

Visual Distinction

  • Full: Focuses on having 0 or 2 children (no "lopsided" nodes)
  • Complete: Focuses on filling levels top-to-bottom, left-to-right
  • Perfect: The ideal case—fully balanced and completely filled

Note: A perfect tree is always both full and complete, but full trees aren't necessarily complete, and complete trees aren't necessarily full.

Key Takeaway: Full trees enforce a 0-or-2 child rule; complete trees fill levels systematically left-to-right; perfect trees are completely symmetrical with all leaves at the same depth.