Manacher's Algorithm and AC Automaton: Linear-Time Palindromes and Multi-Pattern Matching

Manacher's Algorithm Purpose Manacher's algorithm computes the longest palindromic substring centered at each position (including positions between characters for even-length palindromes) in O(n) time complexity. Naive Approach The naive method examines each center position and attempts to expand outward character by character until the charact ...

Posted on Sat, 19 Sep 2026 16:16:48 +0000 by Mathy

Comprehensive Guide to String Operations and Algorithms

Strings are fundamental data structures that store sequences of characters. In C++, strings are zero-indexed and their length can be obtained using len = s.size(). Strings can also be implemented as character arrays with len = strlen(s). Basic String Operations Insretion C++ strings support various insertion methods: string s = "abcd" ...

Posted on Sat, 27 Jun 2026 17:47:12 +0000 by healthnut