code: static int computeCombinedBufferItemCapacity(final int k, final long n) {
      final int totLevels = computeNumLevelsNeeded(k, n);
      if (totLevels == 0) {
        final int bbItems = computeBaseBufferItems(k, n);
        return Math.max(2 * DoublesSketch.MIN_K, ceilingPowerOf2(bbItems));
      }
      return (2 + totLevels) * k;
    }
docs: Returns the total item capacity of an updatable, non-compact combined buffer
  given <i>k</i> and <i>n</i>.  If total levels = 0, this returns the ceiling power of 2
  size for the base buffer or the MIN_BASE_BUF_SIZE, whichever is larger.
  
  @param k sketch parameter. This determines the accuracy of the sketch and the
  size of the updatable data structure, which is a function of <i>k</i> and <i>n</i>.
  
  @param n The number of items in the input stream
  @return the current item capacity of the combined buffer