Algorithm Visualizations

Algorithm Visualizations

Explore algorithm visualizations code snippets and tutorials

Algorithm Visualizations

Cycle sort: Examples & Code

Cycle sort: Rotate permutation cycles into their final positions while handling duplicate values. Explore a worked example, complexity and tested code.

Algorithm Visualizations

Pigeonhole sort: Examples & Code

Pigeonhole sort: Count values in holes spanning the minimum-to-maximum input range, then collect them. Explore a worked example, complexity and tested code.

Algorithm Visualizations

Bucket sort: Examples & Code

Bucket sort: Distribute into ten buckets, sort each bucket by insertion, then concatenate. Explore a worked example, complexity and tested code.

Algorithm Visualizations

Prefix-function construction: Examples & Code

Prefix-function construction: Compute the longest proper prefix that is also a suffix of every string prefix. Explore a worked example, complexity and tested…

Algorithm Visualizations

Z-function construction: Examples & Code

Z-function construction: Compute the longest prefix match starting at each position, reusing the current Z-box. Z[0] is defined as zero. Explore a worked…