How would you print a binary tree in zigzag manner?
Implement zigzag_level_order(root) using breadth-first traversal. The input is a nested dictionary with keys val, left, and right, or None; return a list of levels, alternating traversal direction from left to right and right to left.
The function should return an empty list for an empty tree and must not modify the input tree.
def zigzag_level_order(root):