leetcode讲解--515. Find Largest Value in Each Tree Row

2019-01-07
阅读 2 分钟
1.6k
题目 You need to find the largest value in each row of a binary tree. Example: {代码...} 讲解 又是树的层次遍历题。相同的题我已经做了两个了:637. Average of Levels in Binary Tree、429. N-ary Tree Level Order Traversal Java代码 {代码...}

leetcode讲解--637. Average of Levels in Binary Tree

2019-01-03
阅读 2 分钟
2.1k
Given a non-empty binary tree, return the average value of the nodes on each level in the form of an array.

leetcode讲解--429. N-ary Tree Level Order Traversal

2019-01-02
阅读 2 分钟
2.5k
Given an n-ary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level).

leetcode讲解--669. Trim a Binary Search Tree

2019-01-01
阅读 2 分钟
1.6k
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 result should return the new root of the trimmed binary search tree.

leetcode讲解--897. Increasing Order Search Tree

2018-12-31
阅读 2 分钟
2.4k
Given a tree, rearrange the tree in in-order so that the leftmost node in the tree is now the root of the tree, and every node has no left child and only 1 right child.

leetcode讲解--872. Leaf-Similar Trees

2018-12-29
阅读 2 分钟
1.5k
Consider all the leaves of a binary tree. From left to right order, the values of those leaves form a leaf value sequence.

leetcode讲解--559. Maximum Depth of N-ary Tree

2018-12-26
阅读 2 分钟
1.7k
The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.

leetcode讲解--590. N-ary Tree Postorder Traversal

2018-12-26
阅读 3 分钟
2.1k
Given an n-ary tree, return the postorder traversal of its nodes' values.

leetcode讲解--589. N-ary Tree Preorder Traversal

2018-12-26
阅读 2 分钟
2k
Given an n-ary tree, return the preorder traversal of its nodes' values.