Algo.pw

Algorithm lab

Change an example and start the program to follow the algorithm step by step

Arrays

Data structures

Dynamic programming

Edit distance

cat → cuts
One move inserts, deletes or replaces one symbol. Matching symbols stay as they are.
Start

Longest common subsequence

planet · panel → pane
You may skip letters. The ones you keep must appear in their original order in both words.
Start

Greedy algorithms

Huffman coding

banana → 100110110
Walk from the root to a letter. A left branch gives 0 and a right branch gives 1. Those bits form the letter’s code.
Start

Backtracking

Number theory

Computational geometry

Graph essentials

Trees

Routes and dependencies

Connectivity and spanning trees

Flows and cuts

Matching and assignment

Combinatorial search and networks