摘要: 标签: 动态规划 描述: Given a sequence of integers, find the longest increasing subsequence (LIS). You code should return the length of the LIS. Clarification 阅读全文
posted @ 2016-09-04 11:57 whaochen 阅读(1889) 评论(1) 推荐(0) 编辑
摘要: 标签:动态规划 题目描述: Given two strings, find the longest common subsequence (LCS). Your code should return the length of LCS. 解题思路: 这一题是非常经典的动态规划问题,在解题思路上可以按 阅读全文
posted @ 2016-09-04 07:08 whaochen 阅读(230) 评论(0) 推荐(0) 编辑
摘要: 背包问题: 又是经历了一个非常痛苦的阶段,终于解决了一个非常简单而经典的动态规划问题。 问题描述: 一个旅行者随身带一个背包。可以放背包的物品有n种,每种物品的重量和价值分别为w和v。背包的最大重量限制是b,每种物品可以放多个,怎么放可以使背包价值最大? 思路: 1. 这一道问题属于线性规划问题:由 阅读全文
posted @ 2016-09-04 01:22 whaochen 阅读(336) 评论(0) 推荐(0) 编辑