Algorithm · Microsoft · Medium
Zigzag Level Order Traversal Medium · Topics · Company Tags · Hints Given the root of a binary tree, return a list of lists where each inner list contains the node values at the same depth. The traversal alternates direction with each level: the root level (depth 0) is processed from left to right, the next level from right to left, the level after that left to right, and so on. In other words, perform a zigzag level order traversal. If the tree is empty (root is null),…
Checking your access…