public List<List<Integer>> levelOrder(TreeNode root) {
    	List<List<Integer>> result = new ArrayList<List<Integer>>();
    	if(root == null) return result;
    	Queue<TreeNode> queue = new LinkedList<TreeNode>();
    	int rowIdx = 0;
    	queue.add(root);
    	while(queue.size() != 0){
    		int nowSize = queue.size();
    		int colIdx = 0;
    		result.add(new ArrayList<Integer>());
    		while(nowSize!=0){
    			TreeNode tmp = queue.poll();
    			result.get(result.size() - 1).add(tmp.val);
    			nowSize--;
    			if(tmp.left != null) queue.add(tmp.left);
    			if(tmp.right != null) queue.add(tmp.right);
    			rowIdx++;
    		}
    	}
        return result;
    }