103_Binary Tree Zigzag Level Order Traversal
103. Binary Tree Zigzag Level Order Traversal
Level: medium
Tag: tree, breadth-first search
Question
Example 1
Idea (breadth-first search)
For each level, find all the node value, append to the result as a list. [reverse the node values if it's in even level]
Have a temporary list to store all the left and right child for all the node in the level.
Solution : breadth-first search
Time:
Space:
Last updated