![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
动态规划
文章平均质量分 72
chenshx_sysu
这个作者很懒,什么都没留下…
展开
-
LeetCode 198. House Robber
【题目】You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjace原创 2017-05-06 15:51:22 · 155 阅读 · 0 评论 -
LeetCode 53. Maximum Subarray 题解
最大子序列和问题【题目】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 subarr原创 2017-03-05 12:52:54 · 364 阅读 · 0 评论 -
LeetCode 64. Minimum Path Sum
【题目】Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path.Note: You can only move either down o原创 2017-04-23 23:08:45 · 157 阅读 · 0 评论 -
LeetCode 309. Best Time to Buy and Sell Stock with Cooldown
【题目】Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may complete as many transactions as you like (原创 2017-05-15 19:22:11 · 144 阅读 · 0 评论 -
LeetCode 486. Predict the Winner
【题目】Given an array of scores that are non-negative integers. Player 1 picks one of the numbers from either end of the array followed by the player 2 and then player 1 and so on. Each time a play原创 2017-05-29 21:12:59 · 254 阅读 · 0 评论 -
动态规划(一)
本博客所有问题都可能有多种解法,但这里主要讲解其动态规划的算法1、最长公共子序列2、最长公共子串3、最长递增子序列 最长公共子序列(LCS)【问题描述】 最长公共子序列,英文缩写为LCS,其定义是,一个序列 S ,如果分别是序列(S1,S2……)的子序列,且是所有符合此条件序列中最长的,则 S称为已知序列的最长公共子序列。需要注意的是序列S并原创 2017-04-30 23:52:49 · 186 阅读 · 0 评论