g*s
1 楼
1. word edit distance.
i know it's dp. but what are the legal edit moves?
say, "abcdefg" -> "gabcdef", the distance is 2 or not?
if it's allowed to delete/insert @ any pos, we just delete @ tail and
insert @ head. but the dp recursion definition seems not to cover this
case.
2. longest palindrome substring.
O(N^2) is simple. the optimal is O(N) with suffix tree + lca? anyone can
give a clear description of this solution?
i know it's dp. but what are the legal edit moves?
say, "abcdefg" -> "gabcdef", the distance is 2 or not?
if it's allowed to delete/insert @ any pos, we just delete @ tail and
insert @ head. but the dp recursion definition seems not to cover this
case.
2. longest palindrome substring.
O(N^2) is simple. the optimal is O(N) with suffix tree + lca? anyone can
give a clear description of this solution?