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 other string-processing tasks.
10 resources across 2 libraries
Glossary Terms(7)
Bellman-Ford Algorithm
The Bellman-Ford algorithm is a graph algorithm that computes the shortest paths from a single source vertex to all other vertices in a weighted graph, correct…
Floyd-Warshall Algorithm
The Floyd-Warshall algorithm is a dynamic-programming algorithm that computes the shortest paths between all pairs of vertices in a weighted graph, including g…
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)
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…
How Do You Solve the Longest Repeated Substring Problem?
The longest repeated substring problem asks for the longest substring that occurs at least twice, possibly overlapping, in a given string, and the standard eff…