add(value) {
    if (value > this.findMedian()) {
      // If the new element is greater than the current median, it goes to the min-heap.
      this.min.add(value);
    } else {
      // If it is less than the current median, it goes to the max heap.
      this.max.add(value);
    }

    // rebalance if the sizes of the heaps differ by more than one element
    if (Math.abs(this.min.size - this.max.size) > 1) {
      // extract the min/max from the heap with more elements and insert it into the other heap.
      if (this.min.size > this.max.size) {
        this.max.add(this.min.remove());
      } else {
        this.min.add(this.max.remove());
      }
    }
  }
Add a value to the heap
@runtime O(log n)
@param {any} value