Suffix Tree
A suffix tree is a compressed trie data structure that represents all the suffixes of a given string, enabling extremely fast substring, pattern-matching, and string-analysis queries.
8 resources across 2 libraries
Glossary Terms(5)
Suffix Tree
A suffix tree is a compressed trie data structure that represents all the suffixes of a given string, enabling extremely fast substring, pattern-matching, and…
Suffix Array
A suffix array is a sorted array of all the starting indices of the suffixes of a string, providing a compact data structure for fast substring search and othe…
KMP Algorithm
The Knuth-Morris-Pratt (KMP) algorithm is a string-matching algorithm that finds all occurrences of a pattern within a text in linear time by avoiding redundan…
Rabin-Karp Algorithm
The Rabin-Karp algorithm is a string-matching algorithm that uses a rolling hash function to efficiently find occurrences of a pattern within a text by compari…
Boyer-Moore Algorithm
The Boyer-Moore algorithm is a string-matching algorithm that searches for a pattern in a text by comparing characters from right to left within each alignment…
Interview Questions(3)
How Do You Find the Longest Common Substring?
The longest common substring is the longest contiguous block of characters that appears identically in both strings, found with a 2D dynamic programming table…
What is a Suffix Tree?
A suffix tree is a compressed trie containing every suffix of a given string, built in O(n) time, that lets you answer substring existence, longest common subs…
How Do You Construct a Suffix Array?
A suffix array is built by generating every suffix of a string, sorting those suffixes lexicographically, and storing only their starting indices, which naive…