
找出二叉树每层中最大的元素。
515. Find Largest Value in Each Tree Row
You need to find the largest value in each row of a binary tree.
Example:
1 |
Input: |
算法:层次遍历的同时记录最大节点值
1 |
public List<Integer> (TreeNode root) { |

找出二叉树每层中最大的元素。
You need to find the largest value in each row of a binary tree.
Example:
1 |
Input: |
1 |
public List<Integer> (TreeNode root) { |
近期评论