![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
algo
foreverwingsfly
这个作者很懒,什么都没留下…
展开
-
求数组中最长递增子序列
#include /* 求数组中最长递增子序列长度: 例如:a[10]={1,-1,2,-2,3,-3,4,-4,5,6},递增序列为1,2,3,4,5,6 基本思想: 对于子序列a[0-i],它的最长子序列长度为b[i], 对于子序列a[0-i+1],它的最长子序列有两种情况: 一种是前面的都比a[i+1]大,那么它的最长子序列就是a[i]的最长子序列 一种是前面有比a[i+1]原创 2014-05-02 15:00:44 · 468 阅读 · 0 评论 -
python 排序
python 排序python用for in range的方式真是不习惯,所以搜了一下:for i in range(1, 5): print i 输出是1,2,3,4 range(a,b)返回是 a到b-1 range(a)返回是0到a-1 range(a,b,2)返回的是从a到b-1,每次步长是2 所以range(1,10,2)返回是1,3,5,7,9 想要逆序原创 2015-03-05 21:31:54 · 342 阅读 · 0 评论 -
最大连续子序列
leetcode题目: Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array [−2,1,−3,4,−1,2,1,−5,4], the contiguous subarray [4,−1原创 2015-06-10 21:08:17 · 365 阅读 · 0 评论