- 博客(7)
- 收藏
- 关注
原创 【LeetCode】113. Path Sum II
Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.Note: A leaf is a node with no children.Example:Given the below binary tree and sum = 22,...
2018-10-16 09:32:57 242
原创 【LeetCode】112. 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.Note: A leaf is a node with no children.Example:...
2018-10-13 10:09:53 152
原创 【LeetCode】111. 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 nearest leaf node.Note: A leaf is a node with no childre...
2018-10-13 10:05:04 143
原创 【LeetCode】110. Balanced Binary Tree
Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as:a binary tree in which the depth of the two subtrees of every node never diff...
2018-10-13 09:54:42 129
转载 树的高度和深度
用到树的数据结构时,经常会考虑树的高度和深度,但是lz总是搞混了,总虽然比较简单,就是个定义,记住就行了,但是因为长时间总是弄错,所以写一篇博文,加深一下印象1、树的深度 树的深度可以这样理解,计算一个节点的深度,从根节点算起(记住从1开始计数,而不是0,程序员的通病在这不好使),到该节点所经过的节点数(包括此节点)为树的深度,如下图B的深度为2,k的深度为5.树中最大深度的节点的深度为...
2018-10-13 09:48:25 413
原创 【LeetCode】109. Convert Sorted List to Binary Search Tree
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.For this problem, a height-balanced binary tree is defined as a binary tree in which the ...
2018-10-12 20:09:51 139
转载 对齐次坐标的理解
一直对齐次坐标这个概念的理解不够彻底,只见大部分的书中说道“齐次坐标在仿射变换中非常的方便”,然后就没有了后文,今天在一个叫做“三百年 重生”的博客上看到一篇关于透视投影变换的探讨的文章,其中有对齐次坐标有非常精辟的说明,特别是针对这样一句话进行了有力的证明:“齐次坐标表示是计算机图形学的重要手段之一,它既能够用来明确区分向量和点,同时也更易用于进行仿射(线性)几何变换。”—— F.S. Hill...
2018-10-07 10:29:22 173
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人