Concepts12

βš™οΈAlgorithmAdvanced

Suffix Array Construction

A suffix array stores the starting indices of all suffixes of a string in lexicographic order, enabling fast substring queries and many string operations.

#suffix array#lcp array#kasai+12
βš™οΈAlgorithmIntermediate

Minimum Rotation

The minimum rotation of a string is the lexicographically smallest string you can get by cutting it at some position and swapping the two parts.

#minimum rotation#booth algorithm#duval algorithm+12
βš™οΈAlgorithmAdvanced

Lyndon Factorization

A Lyndon word is a string that is strictly smaller (lexicographically) than all of its nontrivial rotations.

#lyndon word#duval algorithm#booth algorithm+12
βš™οΈAlgorithmIntermediate

KMP - Prefix Function Applications

The prefix function Ο€ of a string tells, for every position, the length of the longest proper prefix that is also a suffix of the prefix ending there.

#kmp#prefix function#failure function+11
βš™οΈAlgorithmIntermediate

Manacher's Algorithm

Manacher's algorithm finds the length of the longest palindrome centered at every position in a string in linear time O(n).

#manacher's algorithm#palindromic substring#longest palindromic substring+11
βš™οΈAlgorithmIntermediate

Longest Common Subsequence

The Longest Common Subsequence (LCS) between two sequences is the longest sequence that appears in both, not necessarily contiguously.

#longest common subsequence#lcs#string dp+12
βš™οΈAlgorithmIntermediate

Edit Distance

Edit distance (Levenshtein distance) measures the minimum number of inserts, deletes, and replaces needed to turn one string into another.

#edit distance#levenshtein#dynamic programming+11
πŸ—‚οΈData StructureAdvanced

Palindromic Tree (Eertree)

A Palindromic Tree (Eertree) stores every distinct palindromic substring of a string as a node and can be built online in linear time.

#palindromic tree#eertree#palindromic substrings+12
πŸ—‚οΈData StructureAdvanced

Suffix Automaton - Advanced Usage

A suffix automaton (SAM) is a compact DFA that captures all distinct substrings of a string and supports many advanced queries in linear time.

#suffix automaton#endpos#suffix link+12
πŸ—‚οΈData StructureAdvanced

Suffix Automaton

A suffix automaton (SAM) is the minimal deterministic finite automaton that recognizes all substrings of a string, built online in O(n) time and space.

#suffix automaton#endpos equivalence#suffix link+12
πŸ—‚οΈData StructureAdvanced

Aho-Corasick Automaton

Aho–Corasick is a trie with failure links that finds all occurrences of many patterns in a single pass over the text.

#aho-corasick#multi-pattern matching#trie+12
πŸ—‚οΈData StructureAdvanced

Suffix Array - LCP Array Applications

The LCP (Longest Common Prefix) array, built alongside a suffix array, unlocks fast solutions to problems like longest repeated substring, number of distinct substrings, and longest common substring.

#suffix array#lcp array#kasai algorithm+12