dsa2 min read
Z-Algorithm — Linear Prefix Matching for All Positions
The Z-algorithm computes Z[i] = length of the longest substring starting at i that matches a prefix of the string. O(n) time, elegant and powerful for pattern search.
Read →
webcoderspeed.com
1 articles
The Z-algorithm computes Z[i] = length of the longest substring starting at i that matches a prefix of the string. O(n) time, elegant and powerful for pattern search.