code: public static int quantile(ModifiableDoubleDBIDList data, int begin, int end, double quant) {
      final int length = end - begin;
      assert (length > 0) : "Quantile on empty set?";
      // Integer division is "floor" since we are non-negative.
      final double dleft = begin + (length - 1) * quant;
      final int ileft = (int) Math.floor(dleft);
  
      quickSelect(data, begin, end, ileft);
      return ileft;
    }
docs: Compute the median of an array efficiently using the QuickSelect method.
  
  It will prefer the lower element.
  
  Note: the array is <b>modified</b> by this.
  
  @param data Data to process
  @param begin Begin of valid values
  @param end End of valid values (exclusive)
  @param quant Quantile to compute
  @return Quantile position