Binary tree preorder: Examples & Code
Binary tree preorder: Traverse a binary tree stored in level-order slots. x represents an absent node. Explore a worked example, complexity and tested code.
Explore algorithm visualizations code snippets and tutorials
Binary tree preorder: Traverse a binary tree stored in level-order slots. x represents an absent node. Explore a worked example, complexity and tested code.
Borůvka minimum spanning forest: Each component chooses its cheapest outgoing undirected edge, then components merge. Explore a worked example, complexity and…
Union–find (rank + path compression): Treat edges as undirected unions. Edge weights are ignored; node values show parents. Explore a worked example,…
Edmonds–Karp maximum flow: Find shortest augmenting paths in the residual network. Source is 0; sink is the highest numbered node. Edge weights are…
Warshall transitive closure: Mark whether every source can reach every destination, including the zero-edge path to itself. Explore a worked example,…