@@ -0,0 +1,1447 @@
+/***%0A * Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level).%0A *%0A * For example:%0A * Given binary tree %7B3,9,20,#,#,15,7%7D,%0A *     3%0A *    / %5C%0A *   9  20%0A *  /  %5C%0A * 15   7%0A * return its level order traversal as:%0A * %5B%0A *   %5B3%5D,%0A *   %5B9,20%5D,%0A *   %5B15,7%5D%0A * %5D%0A */%0A/**%0A * Definition for binary tree%0A * public class TreeNode %7B%0A *     int val;%0A *     TreeNode left;%0A *     TreeNode right;%0A *     TreeNode(int x) %7B val = x; %7D%0A * %7D%0A*/%0Aimport java.util.ArrayList;%0Apublic class Solution %7B%0A    public ArrayList%3CArrayList%3CInteger%3E%3E levelOrder(TreeNode root) %7B%0A        ArrayList%3CArrayList%3CInteger%3E%3E ret = new ArrayList%3CArrayList%3CInteger%3E%3E();%0A        if (root == null) return ret;%0A        ArrayList%3CTreeNode%3E cur = new ArrayList%3CTreeNode%3E();%0A        ArrayList%3CTreeNode%3E next = new ArrayList%3CTreeNode%3E();%0A        ArrayList%3CInteger%3E level = new ArrayList%3CInteger%3E();%0A        cur.add(root);%0A        while (!cur.isEmpty()) %7B%0A            TreeNode n1 = cur.get(0);%0A            cur.remove(0);%0A            level.add(n1.val);%0A            if (n1.left != null)%0A                next.add(n1.left);%0A            if (n1.right != null)%0A                next.add(n1.right);%0A            if(cur.isEmpty()) %7B%0A                cur = next;%0A                ret.add(level);%0A                level = new ArrayList%3CInteger%3E();%0A                next = new ArrayList%3CTreeNode%3E();%0A            %7D%0A        %7D%0A        return ret;%0A    %7D%0A%7D%0A

add BinaryTreeLevelOrderTraversal.java