Leetcode
sitwangmin
这个作者很懒,什么都没留下…
展开
-
617. Merge Two Binary Trees
You need to merge them into a new binary tree. The merge rule is that if two nodes overlap, then sum node values up as the new value of the merged node. Otherwise, the NOT null node will be used as th...原创 2018-07-26 00:28:51 · 94 阅读 · 0 评论 -
872. Leaf-Similar Trees
Consider all the leaves of a binary tree. From left to right order, the values of those leaves form a leaf value sequence.For example, in the given tree above, the leaf value sequence is (6, 7, 4...原创 2018-07-26 00:31:15 · 168 阅读 · 0 评论 -
669. Trim a Binary Search Tree
Given a binary search tree and the lowest and highest boundaries as L and R, trim the tree so that all its elements lies in [L, R] (R >= L). You might need to change the root of the tree, so the re...原创 2018-07-26 00:51:11 · 85 阅读 · 0 评论 -
104. Maximum Depth of Binary Tree
Given 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.Note: A leaf is a node with no childre...原创 2018-07-26 10:08:23 · 96 阅读 · 0 评论 -
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-07-26 10:09:49 · 117 阅读 · 0 评论 -
103. Binary Tree Zigzag Level Order Traversal
Given a binary tree, return the zigzag level order traversal of its nodes’ values. (ie, from left to right, then right to left for the next level and alternate between).For example:Given binary t...原创 2018-07-26 10:10:53 · 118 阅读 · 0 评论 -
559. Maximum Depth of N-ary Tree
Given a n-ary 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.For example, given a 3-ary tree: We ...原创 2018-07-26 10:23:19 · 235 阅读 · 0 评论