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)
Big-O Notation:
means for all . Represents an asymptotic upper bound.
Big-Omega Notation:
means for all . Represents an asymptotic lower bound.
Big-Theta Notation:
means for all . Represents an asymptotically tight bound.
Basic Operation
The most significant operation executed in the innermost loop that contributes most to total running time.
Sieve of Eratosthenes
Algorithm to list all primes up to by iteratively marking multiples of each prime starting at . Runs in time.
Tower of Hanoi Recurrence
with . Requires exactly disk moves.
Convex Hull
The smallest convex polygon enclosing a given set of points. The vertices of this polygon are extreme points.
Assignment Problem Complexity
Assigning people to jobs with an cost matrix has candidate permutations; exhaustive search takes time.
Mobile Element (Johnson-Trotter)
An integer in a directed permutation that points to an immediately adjacent neighbor with a strictly smaller value.
Master Theorem
For : if ; if ; if .
Karatsuba Multiplication
Multiplies two -digit numbers using 3 recursive half-size multiplications instead of 4, running in .
Merge Sort vs Quick Sort
Merge Sort is stable with guaranteed and extra space. Quick Sort is in-place and faster on average, but has worst case.