Sort path (new suffix array order) Bucket boundary (rank changes)
⚠ Couldn't load the engineSomething went wrong initializing the canvas. Reload the page.

Suffix Array Construction: Rank-Space Scatter (2D)

The same O(n log n) prefix-doubling construction as the 3D cube-row simulator, but rendered in the space where the algorithm actually operates: rank space. Every suffix becomes a point whose x-coordinate is its current primary rank and whose y-coordinate is the rank of the suffix k positions further along (or a special row once the window runs past the end of the string) — literally the (rank, rank+k) key pair the comparator sorts by. A white path traces the order the sort derives from that scatter, so watching the path straighten out round by round is watching the suffix array converge, while vertical bucket lines mark where dense ranks change. This is a genuinely distinct visual mechanism from the 3D version's physical re-sorting of rows — a key-space diagram, not a rotated camera — while running the identical rank/comparator-call bookkeeping underneath, so both simulators reach the same finished array in the same number of rounds.