code: function IntegerBufferSet() {
      this.$IntegerBufferSet_valueToPositionMap = {};
      this.$IntegerBufferSet_size = 0;
      this.$IntegerBufferSet_smallValues = new Heap(
        [], // Initial data in the heap
        this.$IntegerBufferSet_smallerComparator
      );
      this.$IntegerBufferSet_largeValues = new Heap(
        [], // Initial data in the heap
        this.$IntegerBufferSet_greaterComparator
      );
  
      this.getNewPositionForValue = this.getNewPositionForValue.bind(this);
      this.getValuePosition = this.getValuePosition.bind(this);
      this.getSize = this.getSize.bind(this);
      this.replaceFurthestValuePosition =
        this.replaceFurthestValuePosition.bind(this);
    }
docs: Data structure that allows to store values and assign positions to them in a way to minimize changing positions of stored values when new ones are added or when some values are replaced. Stored elements are alwasy assigned a consecutive set of positoins startin from 0 up to count of elements less 1 Following actions can be executed * get position assigned to given value (null if value is not stored) * create new entry for new value and get assigned position back * replace value that is furthest from specified value range with new value and get it's position back All operations take amortized log(n) time where n is number of elements in the set.