
Tree
slbyzdgz
这个作者很懒,什么都没留下…
展开
-
LeetCode---Binary Tree Inorder Traversal、Same Tree、Symmetric Tree、Binary Tree Level Order Traversal
94.Binary Tree Inorder TraversalGiven a binary tree, return theinordertraversal of its nodes' values.Example:Input: [1,null,2,3] 1 \ 2 / 3Output: [1,3,2]Follow up:Rec...原创 2019-07-23 21:17:27 · 142 阅读 · 0 评论 -
LeetCode---Sum Root to Leaf Numbers、Binary Tree Preorder Traversal、Binary Tree Postorder Traversal
129.Sum Root to Leaf NumbersGiven a binary tree containing digits from0-9only, each root-to-leaf path could represent a number.An example is the root-to-leaf path1->2->3which represents...原创 2019-08-12 20:43:49 · 137 阅读 · 0 评论 -
LeetCode---Maximum Binary Tree、Second Minimum Node In a Binary Tree、Search in a Binary Search Tree
654.Maximum Binary TreeGiven an integer array with no duplicates. A maximum tree building on this array is defined as follow:The root is the maximum number in the array. The left subtree is the ...原创 2019-08-15 20:44:59 · 153 阅读 · 0 评论 -
LeetCode---N-ary Tree Preorder Traversal、N-ary Tree Postorder Traversal、Merge Two Binary Trees
589.N-ary Tree Preorder TraversalGiven an n-ary tree, return thepreordertraversal of its nodes' values.For example, given a3-arytree:Return its preorder traversal as:[1,3,5,6,2,4].给...原创 2019-08-15 16:57:03 · 170 阅读 · 0 评论 -
LeetCode--- Diameter of Binary Tree、Maximum Depth of N-ary Tree、Average of Levels in Binary Tree
543.Diameter of Binary TreeGiven a binary tree, you need to compute the length of the diameter of the tree. The diameter of a binary tree is the length of thelongestpath between any two nodes in ...原创 2019-08-13 20:37:22 · 181 阅读 · 0 评论 -
LeetCode---Find Bottom Left Tree Value、Find Largest Value in Each Tree Row、Minimum Absolute Differen
513.Find Bottom Left Tree ValueGiven a binary tree, find the leftmost value in the last row of the tree.Example 1:Input: 2 / \ 1 3Output:1Example 2:Input: 1 ...原创 2019-08-13 19:36:54 · 153 阅读 · 0 评论 -
LeetCode--- Path Sum III、Delete Node in a BST、Find Mode in Binary Search Tree
437.Path Sum IIIYou are given a binary tree in which each node contains an integer value.Find the number of paths that sum to a given value.The path does not need to start or end at the root or...原创 2019-08-13 16:57:07 · 229 阅读 · 0 评论 -
LeetCode---Path Sum、Invert Binary Tree、Kth Smallest Element in a BST、最近公共祖先
112.Path SumGiven 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 chil...原创 2019-07-26 19:55:14 · 139 阅读 · 0 评论 -
LeetCode---Convert Sorted Array to Binary Search Tree、Balanced Binary Tree、Minimum Depth of Binary T
108.Convert Sorted Array to Binary Search TreeGiven an array where elements are sorted in ascending order, convert it to a height balanced BST.For this problem, a height-balanced binary tree is d...原创 2019-07-25 21:16:14 · 133 阅读 · 0 评论 -
LeetCode---Maximum Depth of Binary Tree、Construct Binary Tree from Preorder and Inorder Traversal
104.Maximum Depth of Binary TreeGiven a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.Not...原创 2019-07-23 22:04:49 · 148 阅读 · 0 评论 -
LeetCode--- Sum of Left Leaves、N-ary Tree Level Order Traversal
404.Sum of Left LeavesFind the sum of all left leaves in a given binary tree.Example: 3 / \ 9 20 / \ 15 7There are two left leaves in the binary tree, with values 9 and 15...原创 2019-08-12 21:10:45 · 153 阅读 · 0 评论