Three Types
Visual Comparison
Full Binary Tree
A Full Binary Tree is a type of binary tree in which every node has either 0 or 2 children. It is perfectly structured, and all internal nodes have exactly two children while leaves are aligned at the same or adjacent levels, making it balanced for operations and ideal for understanding fundamental tree structures.
Degenerate (Skewed) Tree
A Degenerate or Skewed Tree is a tree where each parent has only one child, making it essentially a linked list. It has the worst-case height of Θ(n), which can occur in unbalanced binary search trees when inserting sorted data without balancing, leading to inefficient operations.
Complete Binary Tree
A Complete Binary Tree is a binary tree in which all levels are fully filled except possibly the last, which is filled from left to right. It is the structure used by heaps, ensuring operations can be performed efficiently with predictable height and balanced shape.
Structural Rules
Full
- Every internal node has exactly two children
- All leaves are on the same or adjacent levels
- Maximum nodes for height h = 2^(h+1) – 1
Degenerate
- Each parent has only one child (left or right)
- Effectively a linked list → Θ(n) height
- Worst-case BST shape when data is sorted
Complete
- All levels fully filled except possibly the last
- Last-level nodes are packed from the left
- Array-based heap relies on this structure
How to Identify a Type
- Count children for every node
- If any node has exactly one child → not full
- If height = n – 1 → degenerate / skewed
- If level-order scan finds a gap before last node → not complete
Height & Complexity
Tree Type | Height |
---|---|
Full (balanced) | Θ(log n) |
Complete | Θ(log n) |
Degenerate / Skewed | Θ(n) |