排序:
默认
按更新时间
按访问量
RSS订阅

分治递归-贪心算法

贪心者,若不犯人,远甚奉献;奉献者,受困于感,舍大为小; 分治递归:递归是一种方法调用方式,深度调用,形式类似于栈的进出。分治的思想最简单的形式就是归并排序,同归讲一个问题拆分为多个问题来求解。分治和递归之所以有联系,是因为大多数场景下,分治的算法,都是同归递归调用来求解的。这样的问题往往也可以...

2019-04-17 23:10:22

阅读数 26

评论数 0

算法再回顾-动态规划

f(n) = f(n-2) + f(n-1) 上面是一道编程题的原型,菲波拉契数列;往往,我们需要求解函数f(n)的结果。 一般有以下几种解法: * 递归算法分;即通过递归调用进行计算,但是这种方法计算了过多的重复值,因而效率低下 * 记忆搜索算法:算法思路还是采用递归思想。不同的是,为了解决重...

2019-04-09 22:48:41

阅读数 30

评论数 0

LeetCode-jump-game

题目描述Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your...

2017-10-05 22:12:14

阅读数 851

评论数 0

LeetCode-jump-game-ii

题目描述Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your...

2017-10-05 21:53:29

阅读数 795

评论数 0

LeetCode-longest-palindromic-substring

题目描述Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique l...

2017-09-10 16:34:05

阅读数 321

评论数 0

LeetCode-Add Two Numbers

题目描述You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a si...

2017-09-10 16:32:26

阅读数 215

评论数 0

LeetCode-Minimum Depth of Binary Tree

题目描述Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the neare...

2017-07-01 18:10:05

阅读数 346

评论数 0

提示
确定要删除当前文章?
取消 删除
关闭
关闭