Graph Algorithms
Traverse networks, find shortest paths and spanning trees.
- Intermediate
Breadth-First Search
Explore level by level with a queue
O(V + E)β
- Intermediate
Depth-First Search
Go deep, then backtrack
O(V + E)β
- Intermediate
Dijkstra's Shortest Path
Shortest paths in a weighted graph
O((V + E) log V)β
- Advanced
A* Pathfinding
Shortest path guided by a heuristic
O(E log V) worst caseβ
- Intermediate
Kruskal's MST
Cheapest edges first, no cycles
O(E log E)β
- Intermediate
Prim's MST
Grow one tree edge by edge
O(E log V) with a heapβ