A suffix array is a sorted array of all suffixes of a string, represented by their starting indices. For the string ‘banana’, the suffixes are ‘banana’, ‘anana’, ’nana’, ‘ana’, ’na’, and ‘a’. Sorting…
Read more →
A suffix array is exactly what it sounds like: a sorted array of all suffixes of a string. Given a string of length n, you generate all n suffixes, sort them lexicographically, and store their…
Read more →
A suffix automaton is the minimal deterministic finite automaton (DFA) that accepts exactly all substrings of a given string. If you’ve worked with suffix trees or suffix arrays, you know they’re…
Read more →
A suffix trie is a trie (prefix tree) that contains all suffixes of a given string. While a standard trie stores a collection of separate words, a suffix trie stores every possible ending of a single…
Read more →
The Longest Repeated Substring (LRS) problem asks a deceptively simple question: given a string, find the longest substring that appears at least twice. The substrings can overlap, which makes the…
Read more →