Standford的一个算法作业题
azhen 2008-04-08 12:14:38 Maximum sum of increasing subsequence
Given an integer array, how will you find out the increasing subsequence which gives the largest sum. For example,
50,23,1,67,30 in this subsequence a few possible increasing subsequences are
1) 23,30
2) 23,67
2) 50,67
3) 1,67
4) 1,30
5) 67
6) 30
but50, 67 gives the maximum sum. How to find it?
我只能想到n^的算法,在网上搜索heaviest increasing string,有现成的解法,复杂度为nlgn,但没看明白.....