自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(17)
  • 收藏
  • 关注

原创 P,NP,NPH,NPC问题

算法系列博客之NPC问题我们已经学习了很多高效的算法,它们大多都是多项式时间的,有的还能达到线性时间,甚至是对数时间。但是到目前为止,仍然有一批问题没有被证明有多项式时间内的算法;所谓没有被证明,即是说明理论上并不能说明它有或者没有多项式时间算法,但是至今为止都没有找到。 下面就要针对这类问题进行定义研究。P问题,polynomial指能够在多项式时间内进行求解的问题; NP问题,nondet

2017-07-12 22:17:33 1921

原创 leetcode - 62,63. Unique Paths(II) & 64.Minimum Path Sum

算法系列博客之Dynamic Programming本篇博客将运用动态规划的思想来解决leetcode上264号问题这三个题目的共同之处在于均是二维矩阵上的规划问题问题描述:62 Unique PathsA robot is located at the top-left corner of a m x n grid (marked ‘Start’ in the diagram below).

2017-06-11 20:40:50 374

原创 leetcode - 264. Ugly Number II

算法系列博客之Dynamic Programming本篇博客将运用动态规划的思想来解决leetcode上264号问题 问题描述:Write a program to find the n-th ugly number. Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For example

2017-06-11 19:54:27 396

原创 leetcode - 152. Maximum Product Subarray

算法系列博客之Dynamic Programming本篇博客将运用动态规划的思想来解决leetcode上198和213号问题 问题描述:Find the contiguous subarray within an array (containing at least one number) which has the largest product.For example, given the

2017-06-11 16:05:55 318

原创 leetcode - 198,213. House Robber(II) & 91. Decode Ways

算法系列博客之Dynamic Programming本篇博客将运用动态规划的思想来解决leetcode上198和213号问题 问题描述:198 House RobberYou are a professional robber planning to rob houses along a street. Each house has a certain amount of money sta

2017-06-11 15:09:24 441

原创 leetcode - 467. Unique Substrings in Wraparound String

算法系列博客之Dynamic Programming本篇博客将运用动态规划的思想来解决leetcode上467号问题 问题描述:Consider the string s to be the infinite wraparound string of “abcdefghijklmnopqrstuvwxyz”, so s will look like this: “…zabcdefghijklm

2017-06-04 17:28:58 338

原创 leetcode - 413. Arithmetic Slices

算法系列博客之Dynamic Programming动态规划是和贪心算法比较相似的一种算法策略       很多时候它们一般都遵从于某种线性的策略,使得整个逻辑和复杂度都看上去是线性的 但其二者有着本质的区别       动态规划实际上是在划分子问题,子问题可以用同种方法进行再度拆解,凑巧划分的过程大多数时候是线性的       而贪心算法则是解决问题的步骤看似是一个

2017-05-03 19:21:47 261

原创 leetcode - 552. Student Attendance Record II

算法系列博客之Dynamic Programming动态规划是和贪心算法比较相似的一种算法策略       很多时候它们一般都遵从于某种线性的策略,使得整个逻辑和复杂度都看上去是线性的 但其二者有着本质的区别       动态规划实际上是在划分子问题,子问题可以用同种方法进行再度拆解,凑巧划分的过程大多数时候是线性的       而贪心算法则是解决问题的步骤看似是一个

2017-05-03 17:27:11 991

原创 leetcode - 316. Remove Duplicate Letters

算法系列博客之GreedyGreedy 贪心算法是一种非常优美的算法,不过贪心算法本身的可行性很多时候会受到一些局限。但是一旦能够找到一种可行的贪心策略,问题的解决将会变得非常高效,因为通常情况下,贪心算法的复杂度是O(n)本篇博客将运用这种思想来解决leetcode上316号问题 问题描述:Given a string which contains only lowercase letter

2017-05-01 23:59:46 445

原创 leetcode - 452. Minimum Number of Arrows to Burst Balloons

算法系列博客之GreedyGreedy 贪心算法是一种非常优美的算法,不过贪心算法本身的可行性很多时候会受到一些局限。但是一旦能够找到一种可行的贪心策略,问题的解决将会变得非常高效,因为通常情况下,贪心算法的复杂度是O(n)本篇博客将运用这种思想来解决leetcode上452号问题 问题描述:There are a number of spherical balloons spread in

2017-05-01 20:51:00 363

原创 leetcode - 135. Candy

算法系列博客之GreedyGreedy 贪心算法是一种非常优美的算法,不过贪心算法本身的可行性很多时候会受到一些局限。但是一旦能够找到一种可行的贪心策略,问题的解决将会变得非常高效,因为通常情况下,贪心算法的复杂度是O(n)本篇博客将运用这种思想来解决leetcode上135号问题 问题描述:There are N children standing in a line. Each child

2017-05-01 18:17:55 334

原创 leetcode - 126. Word Ladder II

算法系列博客之BFSBFS在图的算法中也是比较重要的一种,一般寻找具有某种特征的路径算法都会采用BFS的思想。 本篇博客将利用这种思想解决一个寻找最短路径的问题题目描述Given two words (beginWord and endWord), and a dictionary’s word list, find all shortest transformation sequence(s

2017-04-03 12:35:46 407

原创 leetcode - 210. Course Schedule II

算法系列博客之拓扑排序DFS和入度数组

2017-03-26 13:17:46 441

原创 leetcode - 133. Clone Graph

算法系列博客之DFSDFS(深度优先搜索)在图论的范畴里可以通俗的解释为 总是优先向相连接未访问的下一节点搜索,直到没有这样的节点即返回上一节点 DFS标准格式:Input: G = (V, E) is a Graphprocedure dfs(G): for all v∈V: visited(v) = false for all v∈V:

2017-03-18 18:56:24 281

原创 leetcode - 240.Search a 2D Matrix II

算法系列 — leetcode 题目描述: Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:Integers in each row are sorted in ascending from left to ri

2017-03-11 20:14:30 318

原创 leetcode-Divide and Conquer

算法系列之分治篇选题:215. Kth Largest Element 4. Median of Two Sorted Arrays 这两题简单易解,但是均能通过分治的思想将算法复杂度优化215: Kth Largest Element in an ArrayFind the kth largest element in an unsorted array. Note that it is t

2017-03-05 16:37:01 346

原创 leetCode -Array 154. Find Minimum in Rotated Sorted Array II

算法系列博客154. Find Minimum in Rotated Sorted Array IISuppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2). Find

2017-02-24 23:15:04 284

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

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