🧬 Suffix Array: Indexing Every Ending of a String
Explore how sorting every suffix of a string builds a compact index for lightning-fast substring search, genome matching, and text analysis.
The simulator builds the suffix array and LCP array for a string you provide, then visually sorts every suffix, lets you run a binary search for a chosen pattern, and highlights the matching block of suffixes along with the longest repeated substring.
🔬 What It Demonstrates
The simulator builds the suffix array and LCP array for a string you provide, then visually sorts every suffix, lets you run a binary search for a chosen pattern, and highlights the matching block of suffixes along with the longest repeated substring.
🎮 How to Use
Type or choose a sample string, watch all its suffixes get listed and sorted into the suffix array, then enter a search pattern to see the binary search narrow down to the matching range step by step, and toggle the LCP array view to see shared prefix lengths between neighboring suffixes.
💡 Did You Know?
Suffix array construction algorithms fast enough to index entire human chromosomes, each with hundreds of millions of bases, were a major breakthrough for genome sequencing software, since the naive sorting approach would have been completely impractical at that scale.
Explore the suffix array, a sorted index of all suffixes of a string that enables fast substring search and underlies genome and text search tools.
3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install