public List<List<Integer>> levelOrderBottom(TreeNode root) {
        LinkedList<List<Integer>> result = new LinkedList<List<Integer>>();
        if(root==null){
            return result;
        }
        List<Integer> rootValue = new ArrayList<Integer>();
        rootValue.add(root.val);
        result.push(rootValue);
        LinkedList<TreeNode> queue = new LinkedList<TreeNode>();
        LinkedList<TreeNode> childrenQueue = new LinkedList<TreeNode>();
        queue.add(root);
        while (!queue.isEmpty()){
            TreeNode node = queue.remove();
            if(node.left != null){
                childrenQueue.add(node.left);
            }
            if(node.right!=null){
                childrenQueue.add(node.right);
            }
            if(queue.isEmpty() && !childrenQueue.isEmpty()){
                queue.addAll(childrenQueue);
                List<Integer> childValue = new ArrayList<Integer>();
                for(TreeNode child : childrenQueue){
                    childValue.add(child.val);
                }
                result.push(childValue);
                childrenQueue.clear();
            }
        }
        return result;
    }