Find all palindromic substrings in O(n) time using linear expansion with symmetry reuse.
Knuth-Morris-Pratt pattern matching and prefix function in O(n + m).
Polynomial rolling hash with double hashing for collision-resistant O(1) substring comparison.
Segment tree storing double hash values for range substring hashing with point updates in O(log n).
Deque with O(1) rolling polynomial double hash for constant-time equality comparison.
Prefix tree for string storage with insert, search, prefix check, and erase in O(|s|).
Self-adjusting BST with O(log n) amortized operations via splay rotations.