对于自己印象深刻的或是学习的基础上的编程,跟大家分享一下
最长递增子序列
摘要:最长递增子序列问题是个蛮典型的动态规划问题,相关也有很多人写过文章,经过理解的话,自己整理如下:1 DP问题要找到当前问题与子问题:以dp[]数组记录各个位置[i]处数字为最后一个数字的最长序列, 当前问题:dp[i],与子问题的联系为,比子问题的长度+1 ...
阅读全文
posted @
2015-09-11 15:39
KarayLee
阅读(155)
推荐(0)
Trapping Rain water 诸多细节须注意
摘要:Trapping Rain WaterTotal Accepted:35650Total Submissions:118319My SubmissionsQuestionSolutionGivennnon-negative integers representing an elevation map...
阅读全文
posted @
2015-05-06 22:29
KarayLee
阅读(225)
推荐(0)
最长回文字串理解(学习Manacher's algorithm)
摘要:关于字符串的子串问题,我们经常需要利用的是已经访问的部分的信息,来降低复杂度,和提高效率;在求最长回文子串的问题中,Manacher's algorithm提供了一种很好的机制,虽然部分地方不太容易理解先说下核心的思想:先对原字符串进行预处理,将字符串"abc"转换为"$#a#b#c#"的形式,既避...
阅读全文
posted @
2014-09-02 22:06
KarayLee
阅读(253)
推荐(0)
pat 1068 动态规划/Fina More Conis
摘要:1068. Find More Coins (30)Eva loves to collect coins from all over the universe, including some other planets like Mars. One day she visited a univers...
阅读全文
posted @
2014-06-08 14:12
KarayLee
阅读(1282)
推荐(0)
pat 1047 解题心得
摘要:1047. Student List for Course (25)Zhejiang University has 40000 students and provides 2500 courses. Now given the registered course list of each stude...
阅读全文
posted @
2014-05-04 16:36
KarayLee
阅读(526)
推荐(0)
pat 1038 Smallest Number解题心得
摘要:题目描述:1038. Recover the Smallest Number (30)Given a collection of number segments, you are supposed to recover the smallest number from them. For examp...
阅读全文
posted @
2014-05-03 22:31
KarayLee
阅读(803)
推荐(1)