Skip to content
This repository was archived by the owner on Sep 20, 2023. It is now read-only.

Files

Latest commit

aQuaaQua
aQua
and
aQua
Sep 13, 2017
303adb6 · Sep 13, 2017

History

History
executable file
·
26 lines (22 loc) · 525 Bytes

File metadata and controls

executable file
·
26 lines (22 loc) · 525 Bytes

题目

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 tree [3,9,20,null,null,15,7],

    3
   / \
  9  20
    /  \
   15   7

return its zigzag level order traversal as:

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

解题思路

见程序注释