Binary trees: types and properties
At most two children per node: full, complete, skewed trees and the formulas that come up every year.
Syllabus says: “Binary Trees - Types and Properties”
On this page · 8 sections
Level i holds at most 2^(i−1) nodes; depth k holds at most 2^k − 1. Leaves = (nodes with 2 children) + 1.
A WhatsApp forward where each person forwards to at most 2 friends: level 1 has 1 person, level 2 has 2, level 3 has 4… doubling every level.
A binary tree is a finite set of nodes that is either empty or consists of a root and two disjoint binary trees called the left subtree and the right subtree.
What you will be able to do
- Define a binary tree.
- Explain full, complete and skewed binary trees with examples (Nov 2025 Q14b).
- State and use the binary-tree properties.
Types of binary trees
Books disagree on ‘full’. Horowitz: a full binary tree of depth k has exactly 2^k − 1 nodes (every level full; also called perfect). Many other books: ‘full’ (strict) means every node has 0 or 2 children. In the exam, write the definition you are using and draw an example.
Properties (with one-line proofs)
| Property | Formula | Why |
|---|---|---|
| Max nodes at level i (root = level 1) | 2^(i−1) | each level can at most double |
| Max nodes in a tree of depth k | 2^k − 1 | 1 + 2 + 4 + … + 2^(k−1) |
| Leaves vs degree-2 nodes | n₀ = n₂ + 1 | edges: n − 1 = n₁ + 2n₂, and n = n₀ + n₁ + n₂ |
| Minimum depth with n nodes | ⌈log₂(n + 1)⌉ | invert 2^k − 1 ≥ n |
Let n = n₀ + n₁ + n₂. Every node except the root has exactly one incoming branch, so branches B = n − 1. Every branch leaves a node of degree 1 or 2, so B = n₁ + 2n₂. Equating: n₀ + n₁ + n₂ − 1 = n₁ + 2n₂, so n₀ = n₂ + 1.
Asked in KTU exams (1)
Quick check — can you get them all?
Practice
Every visualizer has a Practice mode: predict the next state before the animation reveals it. You can also work through the topic's question set on the practice page.
Exam-ready summary
- Binary tree: empty, or root + left subtree + right subtree.
- Full (Horowitz) = 2^k − 1 nodes; complete = filled left to right; skewed = one child per node.
- 2^(i−1) per level; 2^k − 1 total; n₀ = n₂ + 1.
References
- Horowitz, Sahni & Anderson-Freed, Fundamentals of Data Structures in C, 2/e — §5.2 (Binary trees)
- Cormen, Leiserson, Rivest & Stein, Introduction to Algorithms, 3/e — Appendix B.5
Explanations on this page are original. Textbook references point to where the standard treatment can be read; no text is reproduced from them.
Prefer revising from notes? Module-wise notes and question papers on Azhimathi Mayam (opens in a new tab)