Foundations
Linear Structures
Hashing
Array and String Patterns
Recursion, Search, and Sorting
Problem Solving Patterns
Algorithm Searching
Sorting Algorithms
Array Algorithms
Grid Algorithms
Linear Structure Algorithms
Hashing Algorithms
Recursion and Backtracking
Greedy Algorithms
Tree and Heap Algorithms
Graph Algorithms
Dynamic Programming Algorithms
String Algorithms
Math Algorithms
Keyboard ready
Space plays. Arrow keys step. R restarts.
LAB Binary Trees Lab
Trees
Concept shape
Core
Definition
A binary tree is a tree where each node has at most two children.
Step 1 / 5
Concept shape
Trees Core
Binary Trees
Welcome to the Binary Trees concept lab. A binary tree is a tree where each node has at most two children. The must know points are: Left and right child are separate positions. Traversal order matters. Not every binary tree is a BST. The common operations are: preorder, inorder, postorder, level order. The complexity shape is Traversal O(n). Watch out for these pitfalls: Assuming left is always smaller. Forgetting empty tree cases. Related algorithms include Tree Traversals, DFS, BFS.
Concept details
A binary tree is a tree where each node has at most two children.
Must know
- Left and right child are separate positions.
- Traversal order matters.
- Not every binary tree is a BST.
Complexity
Traversal O(n)
1.0x