From 192ce44a81de2aa5e43e520776c81593f1a50f5e Mon Sep 17 00:00:00 2001 From: Wander_lust Date: Thu, 29 Jan 2026 14:19:46 +0530 Subject: [PATCH] Add notes on palindrome algorithms Added notes on palindrome algorithms including expand-around-center and Manacher's Algorithm. --- leetcode/lc5/notes.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/leetcode/lc5/notes.md b/leetcode/lc5/notes.md index e69de29..a7b6c5e 100644 --- a/leetcode/lc5/notes.md +++ b/leetcode/lc5/notes.md @@ -0,0 +1,6 @@ +The expand-around-center approach checks every character (and every gap between characters) as a potential palindrome center and expands outward to verify palindromes, resulting in repeated character comparisons and a worst-case time complexity of O(n²). + +In contrast, Manacher’s Algorithm optimizes this process by transforming the string and using palindrome symmetry to reuse previously computed information, thereby eliminating redundant expansions and achieving a linear time complexity of O(n). +in the code +C -> center of the rightmost palindrome +R -> right boundary of rightmost Palindrome