code: public static double selectExcludingZeros(final double[] arr, final int nonZeros, final int pivot) {
      if (pivot > nonZeros) {
        return 0L;
      }
      final int arrSize = arr.length;
      final int zeros = arrSize - nonZeros;
      final int adjK = (pivot + zeros) - 1;
      return select(arr, 0, arrSize - 1, adjK);
    }
docs: Gets the 1-based kth order statistic from the array excluding any zero values in the
  array. Warning! This changes the ordering of elements in the given array!
  
  @param arr The hash array.
  @param nonZeros The number of non-zero values in the array.
  @param pivot The 1-based index of the value that is chosen as the pivot for the array.
  After the operation all values below this 1-based index will be less than this value
  and all values above this index will be greater. The 0-based index of the pivot will be
  pivot+arr.length-nonZeros-1.
  @return The value of the smallest (N)th element excluding zeros, where N is 1-based.