Java concise BFS solution.
    \n    public List<List<Integer>> levelOrder(TreeNode root) {\n        Queue<TreeNode> queue = new LinkedList<>();\n        queue.add(root);\n        List<Li
        \n    public List<List<Integer>> levelOrder(TreeNode root) {\n        Queue<TreeNode> queue = new LinkedList<>();\n        queue.add(root);\n        List<List<Integer>> ret = new ArrayList<>();\n        while (!queue.isEmpty()) {\n            int l = queue.size();\n            List<Integer> level = new ArrayList<>();\n            for (int i = 0; i < l; i++) {\n                TreeNode node = queue.poll(); \n                if (node != null) {\n                    level.add(node.val);\n                    queue.add(node.left);\n                    queue.add(node.right);\n                }\n            }\n            if (!level.isEmpty()) {\n                ret.add(level);\n            }\n        }\n        return ret;\n    }
['Breadth-First Search', 'Java']