![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
leetcode
流风远山
qq号:1060211812
展开
-
leetcode112 path sum
题目Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.For example: Given the below binary tree and sum =原创 2017-09-03 15:55:35 · 273 阅读 · 0 评论 -
leetcode 113 pathSum2
地址:https://leetcode.com/problems/path-sum-ii/description//** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(in原创 2017-09-03 16:35:50 · 212 阅读 · 0 评论 -
Search a 2D Matrix II
文章目录Search a 2D Matrix II题意解释分治的思想Search a 2D Matrix II题意解释大概意思就是采用一种优化算法从M*N行列都从小到大排序好的矩阵中找出目标数。分治的思想采用分治的思想。以题目给出矩阵为例,查找数字5。仔细观察矩阵,最右上角的数字为15,由于矩阵是列递增,所以数字5不可能在最右侧15这一列,我们便可将这一列不予考虑,将范围缩减了一列...原创 2018-12-25 22:05:23 · 111 阅读 · 0 评论