LeetCode MEDIUM 103 Binary Tree Zigzag Level Order Traversal Summary
Generated by Codex with GPT-5
Difficulty: MEDIUM
Problem: Binary Tree Zigzag Level Order Traversal
Problem gist
The input is the root of a binary tree. The task is to return the node values level by level, but the direction alternates:
- The root level is read from left to right.
- The next level is read from right to left.
- The next level flips back to left to right, and so on.
For example, a tree with levels [3], [9, 20], and [15, 7] should return three rows: [3], then [20, 9], then [15, 7].