Skip to algorithms
Algo.pw
Library
RU
EN
Algorithm lab
Change an example and start the program to follow the algorithm step by step
Jump to a topic
Arrays
Graph essentials
Trees
Routes and dependencies
Connectivity and spanning trees
Flows and cuts
Matching and assignment
Combinatorial search and networks
Arrays
Bubble sort
Start →
Binary search
Start →
Fisher–Yates shuffle
Start →
Insertion sort
Start →
Remove duplicates
Start →
Merge two sorted arrays
Start →
Graph essentials
Breadth-first search (BFS)
Start →
Depth-first search (DFS)
Start →
Shortest path with BFS
Start →
Connected components
Start →
Find an undirected cycle
Start →
Bipartite check
Start →
Kahn’s topological sort
Start →
Dijkstra’s algorithm
Start →
Kruskal’s algorithm
Start →
Hierholzer’s Euler walk
Start →
Trees
Preorder binary-tree traversal
Start →
Inorder binary-tree traversal
Start →
Postorder binary-tree traversal
Start →
Subtree sizes
Start →
Tree diameter
Start →
DFS entry and exit times
Start →
Euler tour of a tree
Start →
Lowest common ancestor
Start →
Routes and dependencies
Multi-source BFS
Start →
Bidirectional BFS
Start →
0–1 BFS
Start →
A* search
Start →
Bellman–Ford
Start →
Floyd–Warshall
Start →
Johnson’s algorithm
Start →
Directed cycle detection
Start →
Topological sort with DFS
Start →
Shortest paths in a DAG
Start →
Longest paths in a DAG
Start →
Critical path
Start →
Warshall reachability
Start →
Transitive reduction
Start →
Connectivity and spanning trees
Strong components · Kosaraju
Start →
Strong components · Tarjan
Start →
Bridges
Start →
Articulation points
Start →
Biconnected components
Start →
Disjoint sets (DSU)
Start →
Prim’s algorithm
Start →
Borůvka’s algorithm
Start →
Greedy coloring
Start →
Flows and cuts
Ford–Fulkerson
Start →
Edmonds–Karp
Start →
Minimum cut from a maximum flow
Start →
Dinic’s algorithm
Start →
Push–relabel
Start →
Minimum-cost maximum flow
Start →
Karger’s random contraction
Start →
Global minimum cut — Stoer–Wagner
Start →
Matching and assignment
Kuhn’s matching algorithm
Start →
Hopcroft–Karp
Start →
Hungarian assignment
Start →
Edmonds’ blossom algorithm
Start →
Combinatorial search and networks
Hamiltonian path
Start →
Hamiltonian cycle
Start →
Traveling salesman — Held–Karp
Start →
Maximal cliques — Bron–Kerbosch
Start →
PageRank
Start →