class SparseVector extends Vector {

    @Override
    public SparseVector prefix(double d) {
        int[] indices = new int[this.indices.length + 1];
        double[] values = new double[this.values.length + 1];
        int n = (this.n >= 0) ? this.n + 1 : this.n;

        indices[0] = 0;
        values[0] = d;

        for (int i = 0; i < this.indices.length; i++) {
            indices[i + 1] = this.indices[i] + 1;
            values[i + 1] = this.values[i];
        }

        return new SparseVector(n, indices, values);
    }

    public  SparseVector();
    public  SparseVector(int n);
    public  SparseVector(int n, int[] indices, double[] values);
    public  SparseVector(int n, Map<Integer, Double> kv);

}