JAVA Double Stack Solution
public List<List<Integer>> zigzagLevelOrder(TreeNode root) {\n       TreeNode c=root;\n       List<List<Integer>> ans =new ArrayList<List<Integer>>();\n       i
    public List<List<Integer>> zigzagLevelOrder(TreeNode root) {\n       TreeNode c=root;\n       List<List<Integer>> ans =new ArrayList<List<Integer>>();\n       if(c==null) return ans;\n       Stack<TreeNode> s1=new Stack<TreeNode>();\n       Stack<TreeNode> s2=new Stack<TreeNode>();\n       s1.push(root);\n       while(!s1.isEmpty()||!s2.isEmpty())\n       {\n           List<Integer> tmp=new ArrayList<Integer>();\n            while(!s1.isEmpty())\n            {\n                c=s1.pop();\n                tmp.add(c.val);\n                if(c.left!=null) s2.push(c.left);\n                if(c.right!=null) s2.push(c.right);\n            }\n            ans.add(tmp);\n            tmp=new ArrayList<Integer>();\n            while(!s2.isEmpty())\n            {\n                c=s2.pop();\n                tmp.add(c.val);\n                if(c.right!=null)s1.push(c.right);\n                if(c.left!=null)s1.push(c.left);\n            }\n            if(!tmp.isEmpty()) ans.add(tmp);\n       }\n       return ans;\n    }
['Java']