Description
https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal/description/
Solution
Two things need paying attention:
Using stack plus direction flag to traverse each node.
Pay attention how to instantiate a nested list
1 | /** |
Why don't you come to your senses?
https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal/description/
Two things need paying attention:
1 | /** |