Java queue solution beats 100%
public List> levelOrder(TreeNode root) {\n        \n        List> nodes = new ArrayList<>();\n        if(root==null){\n            return nodes;\n        }\n   
 public List<List<Integer>> levelOrder(TreeNode root) {\n        \n        List<List<Integer>> nodes = new ArrayList<>();\n        if(root==null){\n            return nodes;\n        }\n        \n        LinkedList<TreeNode> queue = new LinkedList<TreeNode>();\n        \n        queue.add(root);\n        \n        while(queue.size()!=0){\n            \n            int size = queue.size();\n            List<Integer> layer_vals = new ArrayList<Integer>();\n            \n            while(size!=0){\n                TreeNode temp = queue.poll();\n                layer_vals.add(temp.val);\n                \n                if(temp.left!=null)queue.add(temp.left);\n                if(temp.right!=null)queue.add(temp.right);\n                \n                size--;\n            }\n            nodes.add(layer_vals);\n        }\n        \n        return nodes;\n        \n    }
['Breadth-First Search', 'Queue', 'Java']