Manacher
memcpy0
希望探索文理结合的自由之路。
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
LeetCode C++ 214. Shortest Palindrome【字符串】困难
Given a string s , you are allowed to convert it to a palindrome by adding characters in front of it. Find and return the shortest palindrome you can find by performing this transformation.Example 1:Input: "aacecaaa"Output: "aaacecaaa"Example 2:Input原创 2020-08-30 03:02:40 · 345 阅读 · 0 评论 -
【算法学习】字符串专题 Manacher算法
文章目录1. 题目:求字符串中最长回文子串的长度2. 进阶:添加字符串形成回文子串3. Manacher算法介绍(1) 中心扩展法(2) Manacher原理(3) 算法时间复杂度(4) 进阶题目解法4. 其他题目1. 题目:求字符串中最长回文子串的长度给出一个字符串 str ,返回 str 中最长回文子串的长度。如 str="123" ,最长的回文子串是 "1", "2", "3" ,所以返回 1 。str="abc1234321ab" ,其中的最长回文子串是 "1234321" ,所以返回 7原创 2020-08-07 21:56:44 · 551 阅读 · 0 评论
分享