modify(position, value) {
    let index = position + this._size;

    this._elementsSum[index] = value;
    this._elementsMin[index] = value;
    this._elementsMax[index] = value;

    for (let i = index; i > 1; i >>= 1) {
      this._elementsSum[i >> 1] = (
        this._elementsSum[i] + this._elementsSum[i ^ 1]
      );

      this._elementsMin[i >> 1] = Math.min(
        this._elementsMin[i], this._elementsMin[i ^ 1]
      );

      this._elementsMax[i >> 1] = Math.max(
        this._elementsMax[i], this._elementsMax[i ^ 1]
      );
    }
  }
Updates the value at index with the given value