Standford的一个算法作业题

azhen azhen 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
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,但没看明白.....
...全文
评论 17
收藏 已收藏
分享
返回顶部
azhen
数据结构与算法 33,027 成员 35,334 内容