Design & Analysis of Algorithms

Open any topic. Modules are collapsible to reduce scrolling. Use search to jump instantly.

Course Overview β†’
Start β†’
No matching topics found. Try a different keyword (example: dfs, master, huffman).
Module 1 β€” Foundations
Why performance matters, what β€œn” means, and how common functions grow.
Open β–Ό
01 β€” Introduction

Why algorithms + performance matter. Feasible vs infeasible intuition.

02 β€” What is input size (n)?

Define n for sorting, graphs (|V|,|E|), strings (n,m), matrices.

03 β€” Growth of functions (Visualizer)

Interactive plots comparing log n, n, n log n, n², 2ⁿ, n! etc.

04 β€” Feasible vs infeasible

Convert operations to time using machine speed.

Module 2 β€” Asymptotic Analysis
Big-O / Ω / Θ, time vs space, and case analysis.
Open β–Ό
05 β€” Asymptotic Notations Visualizer

Play with c and nβ‚€ to test O, Ξ©, and Θ.

06 β€” Time vs Space (Hands-on)

See trade-offs using toy algorithms (search, merge sort, DP).

07 β€” Best / Average / Worst Case

Same algorithm, different inputs β†’ different runtime behavior.

Module 3 β€” From Code to Recurrence
Turn loops into counts, recursion into recurrences, and build intuition before Master Theorem.
Open β–Ό
09 β€” Cost From Code (Loops + Recurrence Playground)

Loops β†’ summation, recursion β†’ recurrence, then solve (3 methods).

10 β€” Step Counter Simulator (Loops vs Recursion)

Mini-debugger style view: see which line dominates runtime.

Module 4 β€” Recurrence & Recursion Trees
Build intuition for divide-and-conquer recurrences and prepare Master Theorem.
Open β–Ό
08 β€” Recursion Tree Visualizer

Visual expansion of common recurrences and their growth.

11 β€” Master Theorem

Case 1/2/3 solver for T(n)=aT(n/b)+f(n).

Module 5 β€” Divide & Conquer
Binary search, max-min, merge sort, quick sort, randomized quick sort, Karatsuba intro.
Open β–Ό
12 β€” Binary Search

Trace l/m/r step-by-step + comparisons count.

13 β€” Max & Min (D&C)

Fewer comparisons than linear scan (tournament method).

14 β€” Merge Sort

Split + merge animation, O(n log n).

15 β€” Quick Sort: Lomuto Partition

The pivot-placement subroutine used in Quick Sort (Lomuto scheme).

16 β€” Randomized Quick Sort

Expected performance intuition (random pivot).

17 β€” Integer Multiplication (Karatsuba)

3 multiplications instead of 4 + recurrence.

Module 6 β€” Graph Search
Graph representation, BFS, DFS (animations).
Open β–Ό
18 β€” Graph Representation

Adjacency list vs matrix (space/time trade-offs).

19 β€” BFS

Queue animation + levels + shortest path (unweighted).

20 β€” DFS

Recursion/stack animation + traversal tree.

Module 7 β€” Greedy Strategy
Knapsack, job sequencing, Huffman, MST, shortest paths (Dijkstra).
Open β–Ό
21 β€” Greedy Intro

Greedy-choice property + counterexamples.

22 β€” Fractional Knapsack

Sort by value/weight and fill capacity.

23 β€” Job Sequencing

Maximize profit with deadlines (slot filling).

24 β€” Huffman Coding

Min-heap merge to build optimal prefix codes.

25 β€” Union-Find

MakeSet / Find / Union with compression & rank.

26 β€” MST (Kruskal)

Sorted edges + union-find acceptance/rejection.

27 β€” MST (Prim)

Grow MST using priority queue (frontier edges).

28 β€” Dijkstra

Greedy relaxation for non-negative weights.

Module 8 β€” Dynamic Programming
Bellman-Ford, Floyd-Warshall, Knapsack DP, LCS, Edit distance, MCM, TSP (DP).
Open β–Ό
29 β€” DP Intro

Memoization vs tabulation; overlapping subproblems.

30 β€” Bellman-Ford

Vβˆ’1 relaxations + negative cycle detection.

31 β€” Floyd–Warshall

APSP DP over intermediate k.

32 β€” 0/1 Knapsack (DP)

DP table fill + backtrack chosen items.

33 β€” LCS

DP grid visual + reconstruction.

34 β€” Matrix Chain Multiplication

Optimal parenthesization DP.

35 β€” Edit Distance

Insert/delete/replace DP grid.

36 β€” TSP (DP/Bitmask)

Small n demo + 2ⁿ state explosion.

Module 9 β€” Backtracking
N-Queens, graph coloring, Hamiltonian cycle (state space + pruning).
Open β–Ό
37 β€” Backtracking Intro

Decision tree + pruning visualization.

38 β€” N-Queens

Board animation + conflict checks.

39 β€” Graph Coloring

m-coloring backtracking + pruning.

40 β€” Hamiltonian Cycle

Path building + prune when no edge.

Module 10 β€” Branch & Bound
Bounding, live nodes, 0/1 knapsack and TSP using B&B.
Open β–Ό
41 β€” Branch & Bound Intro

FIFO vs least-cost strategy + bounds.

42 β€” 0/1 Knapsack (B&B)

Upper bound pruning (via fractional knapsack bound).

43 β€” TSP (B&B)

Lower bound + pruning for TSP search.

Module 11 β€” String Matching
NaΓ―ve, Rabin–Karp, KMP (pattern matching).
Open β–Ό
44 β€” NaΓ―ve String Matching

O(nΒ·m) comparisons visualization.

45 β€” Rabin–Karp

Rolling hash window demo + collisions note.

46 β€” KMP

LPS build + skip comparisons (O(n+m)).

Module 12 β€” NP & Complexity
P vs NP, NP-Complete, NP-Hard, reductions.
Open β–Ό
47 β€” Complexity Classes

Quick map: P, NP, NP-Complete, NP-Hard + examples.

48 β€” Reductions (SAT β†’ VC)

Reduction pipeline sketch + why it matters.