DSAverse
String Algorithms
Loading String Algorithms...
Pattern Matching
A
B
A
B
C
A
B
A
B
A
B
A
B
text / pattern
Initializing Sorting Algorithms...
Sorting
Trees
Graphs
Preparing interactive visualizations...
String Algorithms
Loading String Algorithms...
Pattern Matching
text / pattern
Compute Z[i] — the longest prefix match at each position — in O(n) using a sliding Z-box to avoid redundant comparisons.
What does Z[i] represent in the Z-array?