public List<List<Integer>> levelOrderBottom(TreeNode root) {
        List<List<Integer>> hashMap = new ArrayList<List<Integer>>();
        if (root == null)
            return hashMap;
        Queue<TreeNode> queue = new LinkedList<TreeNode>();
        queue.offer(root);
        while (!queue.isEmpty()) {
            int size = queue.size();
            List<Integer> temp = new ArrayList<Integer>();
            for (int i = 0; i < size; ++i) {
                if (queue.peek().left != null)
                    queue.offer(queue.peek().left);
                if (queue.peek().right != null)
                    queue.offer(queue.peek().right);
                temp.add(queue.poll().val);
            }
            hashMap.add(temp);
        }
        List<List<Integer>> res = new ArrayList<List<Integer>>();
        while (hashMap.size() != 0) {
            res.add(hashMap.remove(hashMap.size() - 1));
        }
        return res;
    }