Algorithm Visualizations

Algorithm Visualizations

Explore algorithm visualizations code snippets and tutorials

Algorithm Visualizations

Longest increasing subsequence: Examples & Code

Longest increasing subsequence: For each value, extend the longest strictly increasing subsequence ending at an earlier smaller value. Explore a worked…

Algorithm Visualizations

Prime factorization (trial division): Examples & Code

Prime factorization (trial division): Repeatedly divide by each candidate factor. Explore a worked example, complexity and tested code.

Algorithm Visualizations

Modular exponentiation: Examples & Code

Modular exponentiation: Square the base and halve the exponent, multiplying the result for odd exponents. Explore a worked example, complexity and tested code.

Algorithm Visualizations

Least common multiple: Examples & Code

Least common multiple: Use the Euclidean GCD to compute a / gcd(a,b) × b. Explore a worked example, complexity and tested code.

Algorithm Visualizations

Ternary search (sorted array): Examples & Code

Ternary search (sorted array): Inspect two dividing points and retain one third of the sorted search interval. Input is sorted before searching. Explore a…