Python with Queue
\nclass Solution:\n    def zigzagLevelOrder(self, root: TreeNode) -> List[List[int]]:\n        if not root:\n            return []\n        \n        res = []\n
```\nclass Solution:\n    def zigzagLevelOrder(self, root: TreeNode) -> List[List[int]]:\n        if not root:\n            return []\n        \n        res = []\n        queue = []\n        \n        queue.append((root,1))\n        while queue:\n            n = len(queue)\n            nodeList = []\n            for _ in range(n):\n                curNode, level = queue.pop(0)\n                if level%2 == 1:\n                    nodeList.append(curNode.val)\n                else:\n                    nodeList.insert(0,curNode.val)\n                \n                if curNode.left: queue.append((curNode.left,level+1))\n                if curNode.right: queue.append((curNode.right,level+1))\n            \n            res.append(nodeList)\n        \n        return res\n\t```
['Python']