Exam Practice
Master algorithm efficiency analysis, recurrences, combinatorial generation, divide-and-conquer, and midterm exam problems based on Levitin (3rd ed).
Reference text: Introduction to the Design and Analysis of Algorithms, 3rd Edition (Anany Levitin)
Master Theorem Reference:
| Condition | Resulting Complexity | Dominant Phase | Example Algorithm |
|---|---|---|---|
| Root-dominated (combining) | |||
| Balanced across all tree levels | |||
| Leaf-dominated (subproblems) |
Algorithm Complexities Summary (Chapters 1–5)
| Algorithm | Design Strategy | Best Case | Average Case | Worst Case | Space |
|---|---|---|---|---|---|
| Sieve of Eratosthenes | Brute Force / Elimination | ||||
| Selection Sort | Brute Force | ||||
| Bubble Sort | Brute Force | ||||
| Insertion Sort | Decrease-by-1 | ||||
| Sequential String Match | Brute Force | ||||
| 2D Board Match | Brute Force | ||||
| Closest Pair (Brute Force) | Brute Force | ||||
| Convex Hull (Brute Force) | Brute Force | ||||
| TSP (Exhaustive Search) | Exhaustive Search | ||||
| Knapsack (Exhaustive) | Exhaustive Search | ||||
| Assignment Problem | Exhaustive Search | ||||
| Tower of Hanoi | Decrease-by-1 / D&C | ||||
| Binary Search | Decrease-by-factor-2 | ||||
| Euclid GCD | Variable-Size Decrease | ||||
| Merge Sort | Divide-and-Conquer | ||||
| Quick Sort | Divide-and-Conquer | ||||
| Closest Pair (D&C) | Divide-and-Conquer | ||||
| Karatsuba Multiplication | Divide-and-Conquer | ||||
| Strassen Matrix Mult | Divide-and-Conquer |
Essential Summation Formulas & Recurrence Identities
Sum of First Integers
Sum of Squares
Finite Geometric Series
Halving Recurrence
Doubling Recurrence
Merge Sort Recurrence