@@ -0,0 +1,1141 @@
+/**%0A * Definition for a binary tree node.%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 */%0Apublic class Solution %7B%0A    public List%3CList%3CInteger%3E%3E levelOrder(TreeNode root) %7B%0A        if(root == null)%7B%0A            return Collections.EMPTY_LIST;%0A        %7D%0A        List%3CList%3CInteger%3E%3E result = new ArrayList%3CList%3CInteger%3E%3E();%0A        List%3CInteger%3E tmp = new ArrayList%3CInteger%3E();%0A        Queue%3CTreeNode%3E q = new LinkedList%3CTreeNode%3E();%0A        q.add(root);%0A        int upper = 1, lower = 0;%0A        while(q.peek() != null)%7B%0A            if(q.peek().left != null)%7B%0A                q.add(q.peek().left);%0A                lower ++;%0A            %7D%0A            if(q.peek().right != null)%7B%0A                q.add(q.peek().right);%0A                lower ++;%0A            %7D%0A            tmp.add(q.peek().val);%0A            upper--;%0A            if(upper == 0)%7B%0A                result.add(tmp);%0A                upper = lower;%0A                lower = 0;%0A                tmp = new ArrayList%3CInteger%3E();%0A            %7D%0A            q.remove();%0A        %7D%0A        return result;%0A    %7D%0A%7D

Q102 Binary Tree Level Order Traversal