
LeetCode-Tree
R_zz
这个作者很懒,什么都没留下…
展开
-
LeetCode-107. Binary Tree Level Order Traversal II
问题:https://leetcode.com/problems/binary-tree-level-order-traversal-ii/?tab=Description Given a binary tree, return the bottom-up level order traversal of its nodes’ values. (ie, from left to right, le原创 2017-02-28 16:44:54 · 233 阅读 · 0 评论 -
LeetCode-437. Path Sum III
问题: https://leetcode.com/problems/path-sum-iii/?tab=Description You 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 pat原创 2017-03-01 16:42:27 · 193 阅读 · 0 评论 -
LeetCode-404. Sum of Left Leaves
问题:https://leetcode.com/problems/sum-of-left-leaves/?tab=Description Find the sum of all left leaves in a given binary tree.求左叶子节点的和。 Example: 3 / \ 9 20 / \ 15 7 There are原创 2017-03-01 15:59:24 · 191 阅读 · 0 评论 -
LeetCode-111. Minimum Depth of Binary Tree
问题: https://leetcode.com/problems/minimum-depth-of-binary-tree/?tab=Description Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the r原创 2017-03-01 15:29:39 · 197 阅读 · 0 评论 -
LeetCode-108. Convert Sorted Array to Binary Search Tree
问题: https://leetcode.com/problems/convert-sorted-array-to-binary-search-tree/?tab=Description Given an array where elements are sorted in ascending order, convert it to a height balanced BST. 给定一个数组原创 2017-03-01 15:18:55 · 195 阅读 · 0 评论 -
LeetCode-501. Find Mode in Binary Search Tree
问题:https://leetcode.com/problems/find-mode-in-binary-search-tree/?tab=Description Given a binary search tree (BST) with duplicates, find all the mode(s) (the most frequently occurred element) in the g转载 2017-03-01 15:08:32 · 618 阅读 · 0 评论 -
LeetCode-112. Path Sum
问题:https://leetcode.com/problems/path-sum/?tab=Description 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 giv原创 2017-03-01 11:28:12 · 338 阅读 · 0 评论 -
LeetCode-226. Invert Binary Tree
问题:https://leetcode.com/problems/invert-binary-tree/?tab=Description Invert a binary tree.交换左右子树。 4 / \ 2 7 / \ / \ 1 3 6 9 to 4 / \ 7 2 / \ / \ 9原创 2017-03-01 11:16:33 · 202 阅读 · 0 评论 -
LeetCode-104. Maximum Depth of Binary Tree
问题:https://leetcode.com/problems/maximum-depth-of-binary-tree/?tab=Description Given a binary tree, find its maximum depth.给一个二叉树,返回它的最大深度。 The maximum depth is the number of nodes along the longest原创 2017-03-01 11:04:33 · 181 阅读 · 0 评论 -
LeetCode-235. Lowest Common Ancestor of a Binary Search Tree
问题: https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-search-tree/?tab=Description Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST原创 2017-03-01 10:47:26 · 350 阅读 · 0 评论 -
LeetCode-110. Balanced Binary Tree
问题:https://leetcode.com/problems/balanced-binary-tree/?tab=Description Given a binary tree, determine if it is height-balanced. 判断二叉树是否为平衡二叉树。 For this problem, a height-balanced binary tree is defin原创 2017-03-01 10:20:30 · 179 阅读 · 0 评论 -
LeetCode-101. Symmetric Tree
问题:https://leetcode.com/problems/symmetric-tree/?tab=Description Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). 给一个二叉树,判断是否它是镜像二叉树或者是它本身。 For example,原创 2017-02-28 17:12:40 · 194 阅读 · 0 评论 -
LeetCode-100. Same Tree
问题:https://leetcode.com/problems/same-tree/?tab=Description Given two binary trees, write a function to check if they are equal or not. Two binary trees are considered equal if they are structurally原创 2017-02-28 16:52:58 · 336 阅读 · 0 评论 -
LeetCode-257. Binary Tree Paths
问题: https://leetcode.com/problems/binary-tree-paths/?tab=Description Given a binary tree, return all root-to-leaf paths. 给定一棵树,找出所有从根到叶子节点的路径 For example, given the following binary tree: 1原创 2017-03-01 17:10:18 · 219 阅读 · 0 评论