EASIEST JAVA SOLUTION😎✌️ || STEP BY STEP EXPLAINED😁
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->O(N)\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->O(N)\n![Screenshot_20230205_171246.png](https://assets.leetcode.com/users/images/967e082c-1572-4190-a249-35b49767a9a2_1680359653.9038227.png)\n\n\n# Code\n```\n/**\n * Definition for a binary tree node.\n * public class TreeNode {\n *     int val;\n *     TreeNode left;\n *     TreeNode right;\n *     TreeNode() {}\n *     TreeNode(int val) { this.val = val; }\n *     TreeNode(int val, TreeNode left, TreeNode right) {\n *         this.val = val;\n *         this.left = left;\n *         this.right = right;\n *     }\n * }\n */\nclass Solution {\n    public List<List<Integer>> zigzagLevelOrder(TreeNode root) {\n        \n        // Create a queue to store the tree nodes\n        Queue<TreeNode> queue = new LinkedList<TreeNode>();\n\n        // Create an array list to store the final result\n        List<List<Integer>> wrapList = new ArrayList<>();\n     \n        // If the root node is null, return an empty list\n        if(root == null){\n            return wrapList;\n        }\n     \n        // Add the root node to the queue\n        queue.add(root);\n     \n        // Set the flag to true for left to right traversal\n        boolean flag = true;\n     \n        // Traverse the tree level by level\n        while(!queue.isEmpty()){\n            \n            // Get the number of nodes at the current level\n            int size = queue.size();\n\n            // Create an array list to store the nodes\' values at the current level\n            List<Integer> subList = new ArrayList<>();\n         \n            // Traverse the nodes at the current level\n            for(int i =0; i < size; i++){\n\n                // Check the left and right child of the current node and add them to the queue if they are not null\n                if(queue.peek().left != null){\n                    queue.add(queue.peek().left);\n                }\n                if(queue.peek().right != null){\n                    queue.add(queue.peek().right);\n                }\n\n                // For left to right traversal\n                if(flag == true){\n                    // Add the node\'s value to the end of the subList\n                    subList.add(queue.poll().val);\n                }\n                // For right to left traversal\n                else{\n                    // Add the node\'s value to the beginning of the subList\n                    subList.add(0,queue.poll().val);\n                }\n            }\n            // Toggle the flag to switch between left to right and right to left traversal\n            flag = !flag;\n         \n            // Add the subList to the wrapList\n            wrapList.add(subList);\n        }\n        // Return the final result\n        return wrapList;\n    }\n}\n```
['Tree', 'Breadth-First Search', 'Queue', 'Binary Tree', 'Java']