题目链接:Longest Palindromic Substring 1. 问题描述 Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substring. 2. 各种解法复杂度 暴力枚举:O(N^2) 记忆化搜索:O(N…
引 入 引入 引入 Manachar算法主要是处理字符串中关于回文串的问题的,这没什么好说的. M a n a c h e r 算 法 Manacher算法 Manacher算法 朴素 求一个字符串中以每个点为中心的最长回文子串,这是 m a n a c h e r manacher manacher 直接解决的问题. 以每个点为中心的回文子串是连续的,它并不像字符串的 b o r d e r border border ,因此可以二分,于是在不知道 m a n a c h e r manach…