摘要: 动态规划求数组中最长的上升序列(LongestIncreasingSubsequence)的个数,复杂度为O(n^2)。 例如:数组int arr[] = {7,3,5,9,4,6,8,10},最长上升序列应该为3,5,6,8,10或3,4,6,8,10 ,最终答案应该为5; dp[i]表示数组中以 阅读全文
posted @ 2017-09-13 11:20 KIDong123 阅读(269) 评论(0) 推荐(0) 编辑