C9389ae1d9509ecb6c2854ed25561bd6
(难度Easy) Problem 107. Binary Tree Level Order Traversal II(二叉树节点归并II)

Binary Tree Level Order Traversal II

Difficulty

Easy

Description

Given a binary tree, return the _bottom-up level order_ traversal of its
nodes' values. (ie, from left to right, level by level from leaf to root).

For example:
Given binary tree [3,9,20,null,null,15,7],

    3
   / \
  9  20
    /  \
   15   7

return its bottom-up level order traversal as:

[
  [15,7],
  [9,20],
  [3]
]

题意

给定一棵二叉树,要求按照树深归并元素

top Created with Sketch.