摘要: 原题地址:https://oj.leetcode.com/problems/minimum-path-sum/题意:Given amxngrid filled with non-negative numbers, find a path from top left to bottom right w... 阅读全文
posted @ 2014-05-26 17:56 南郭子綦 阅读(2757) 评论(0) 推荐(0) 编辑
摘要: 原题地址:https://oj.leetcode.com/problems/climbing-stairs/题意:You are climbing a stair case. It takesnsteps to reach to the top.Each time you can either cl... 阅读全文
posted @ 2014-05-26 17:32 南郭子綦 阅读(4393) 评论(0) 推荐(0) 编辑
摘要: 原题地址:https://oj.leetcode.com/problems/clone-graph/题意:实现对一个图的深拷贝。解题思路:由于遍历一个图有两种方式:bfs和dfs。所以深拷贝一个图也可以采用这两种方法。不管使用dfs还是bfs都需要一个哈希表map来存储原图中的节点和新图中的节点的一... 阅读全文
posted @ 2014-05-26 17:15 南郭子綦 阅读(5355) 评论(0) 推荐(0) 编辑
摘要: 原题地址:https://oj.leetcode.com/problems/path-sum-ii/题意:Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given... 阅读全文
posted @ 2014-05-26 10:11 南郭子綦 阅读(3283) 评论(0) 推荐(0) 编辑
摘要: 原题地址:https://oj.leetcode.com/problems/path-sum/题意:Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all... 阅读全文
posted @ 2014-05-26 09:56 南郭子綦 阅读(3559) 评论(0) 推荐(0) 编辑
摘要: 原题地址:https://oj.leetcode.com/problems/unique-binary-search-trees-ii/题意:接上一题,这题要求返回的是所有符合条件的二叉查找树,而上一题要求的是符合条件的二叉查找树的棵数,我们上一题提过,求个数一般思路是动态规划,而枚举的话,我们就考... 阅读全文
posted @ 2014-05-26 09:39 南郭子綦 阅读(4109) 评论(1) 推荐(0) 编辑