Dynamic programming, Dijkstra with SplPriorityQueue, tries, topological sort and union-find: the interview classics, in PHP that reads well.