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 Recursion Basics Lab
Problem Solving
Concept shape
Core
0
1
2
3
4
5
Definition
A recursive function solves a problem by calling itself on a smaller problem.
Step 1 / 5
Concept shape
Problem Solving Core
Recursion Basics
Welcome to the Recursion Basics concept lab. A recursive function solves a problem by calling itself on a smaller problem. The must know points are: Every recursion needs a base case. Recursive calls use stack memory. Tree recursion can grow exponentially. The common operations are: base case, recursive case, combine result. The complexity shape is Depends on branching and depth. Watch out for these pitfalls: Missing base case. Not reducing the problem. Ignoring stack depth. Related algorithms include Tree Traversal, Merge Sort, Backtracking.
Concept details
A recursive function solves a problem by calling itself on a smaller problem.
Must know
- Every recursion needs a base case.
- Recursive calls use stack memory.
- Tree recursion can grow exponentially.
Complexity
Depends on branching and depth
1.0x