v1.0.0

Algorithm Visualization Examples in Python

The algorithm patterns that come up again and again in LeetCode problems and coding interviews. Each example explains the idea, shows a short Python solution and opens it in the visualizer, where you can watch it run line by line: pointers moving over arrays, trees and grids being explored, the call stack growing and shrinking.

See the two pointers technique step by step: watch left and right close in on a sorted array in an animated Python visualization (Two Sum II, LeetCode 167).

Watch a sliding window grow and shrink over a string, step by step, in an animated Python visualization (Longest Substring Without Repeating Characters).

Visualize binary search step by step: see lo, mid and hi move over a sorted array and the search space halve on every comparison (LeetCode 704).

Visualize breadth-first search on a binary tree: watch the queue and the tree level by level in an animated Python step-by-step trace (LeetCode 102).

Watch breadth-first search flood-fill a 2D grid step by step. An animated Python visualization of Number of Islands (LeetCode 200) with the matrix and queue.