t******e 发帖数: 98 | 1 问题如下:
Given a string 's = s1s2...sn', then the longest common subsequence of 's'
and its reverse 'R(s)' is also the longest palindromic subsequence in 's'.
e.g. the longest palindromic subsequence of string 's=abcadd' is 'aba'.
我觉得这个算法用来寻找longest palindromic subsequence (not substring)是很方
便的(Complexity O(n^2)),但是没有想出如何证明算法的正确性,想请教高手帮忙,谢
谢了. | r********g 发帖数: 1351 | |
|