public int insert(int v) {
        TreeNode nn = new TreeNode(v);
        int levelSize = map.get(level).size();
        if (levelSize == (int) Math.pow(2, level - 1)) {
            TreeNode parent = map.get(level).get(0);
            parent.left = nn;
            level++;
            map.put(level, new ArrayList<>());
            map.get(level).add(nn);
            return parent.val;
        } else {
            int sz = map.get(level).size();
            TreeNode parent = map.get(level - 1).get(sz / 2);
            if (parent.left == null)
                parent.left = nn;
            else
                parent.right = nn;
            map.get(level).add(nn);
            return parent.val;
        }
    }
Why Did you create this class? what does it do?
src/problems/medium/CBTInserter.java