Python simple BFS
Simple straightforward solution using flag to decide whether from left to right or from right to left\n\n    class Solution(object):\n    def zigzagLevelOrder(s
Simple straightforward solution using flag to decide whether from left to right or from right to left\n\n    class Solution(object):\n    def zigzagLevelOrder(self, root):\n        """\n        :type root: TreeNode\n        :rtype: List[List[int]]\n        """\n        if not root: return []\n        res, temp, stack, flag=[], [], [root], 1\n        while stack:\n            for i in xrange(len(stack)):\n                node=stack.pop(0)\n                temp+=[node.val]\n                if node.left: stack+=[node.left]\n                if node.right: stack+=[node.right]\n            res+=[temp[::flag]]\n            temp=[]\n            flag*=-1\n        return res
[]