Graph algorithms
Graph algorithms operate on nodes and edges and show up anywhere you model "things and their relationships" — social networks, road maps, package dependencies, the web itself. The core toolkit: BFS (breadth-first search) — level-by-level exploration using a queue, gives shortest paths in unweighted graphs; DFS (depth-first search) — go deep first with a stack or recursion, good for cycle detection and topological sort; Dijkstra — shortest path when edges have non-negative weights, O((V+E) log V) with a priority queue; Topological sort — linear ordering respecting dependencies, used by every package manager and build system; Minimum spanning tree (Kruskal, Prim) — connect all nodes with minimum total edge weight. Most practical graph problems reduce to one of these five; the trick is recognising which.