马拉松算法(Manacher's algorithm) (未完成)
摘要:马拉松算法:马拉松算法是用来计算一个字符串中最长的回文字符串(对称字符串,如aba abba)。 首先,我们拿到一个字符串S,然后在S中的每个字符之间加#。例如:S="abcb" T="a#b#c#b" 我们T字符串的每一个T[i]向延伸d个字符 使得 T[i-d,i+d]是一个回文字符串。你会立刻
阅读全文
leetcode 003 找出一个字符串中最长的无重复片段
摘要:题目: Given a string, find the length of the longest substring without repeating characters. Examples: Given "abcabcbb", the answer is "abc", which the
阅读全文
leetcode 002 两个数相加
摘要:题目:You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes con
阅读全文