DDSA Solutions

String Matching

5 problems

String matching finds occurrences of a pattern in text. KMP runs in O(n+m) using a failure function to skip redundant comparisons. Rabin-Karp uses rolling hashes for average O(n+m). Z-algorithm and suffix arrays support more general substring queries.