摘要: 最长公共子序列问题又称LCS问题(longest common subsequence problem) 问题描述: 给你两个字符串str1和str2,它们之间可能存在公有子序列,子序列和子串的区别是:子序列不要求连续,只需要按照顺序出现就好,子串则要求连续: 例如:SIMPLE和NAIVE有共同的 阅读全文
posted @ 2016-11-26 20:25 侯胜滔 阅读(4642) 评论(0) 推荐(0) 编辑
摘要: 利用堆栈:http://oj.leetcode.com/problems/evaluate-reverse-polish-notation/http://oj.leetcode.com/problems/longest-valid-parentheses/ (也可以用一维数组,贪心)http://o 阅读全文
posted @ 2016-11-26 17:09 侯胜滔 阅读(310) 评论(0) 推荐(0) 编辑