quick sort algorithm

@param arr an array of Comparable items
333234
public static <T extends Comparable<? super T>> void quicksort( T[] arr )
    {
        quicksort( arr, 0, arr.length - 1 );
    }
1076750
private static <T extends Comparable<? super T>> 
    void quicksort( T[] arr, int left, int right )
    {
        if ( left + CUTOFF <= right  ) {
            //find the pivot
            T pivot = median( arr, left, right );
            
            //start partitioning
            int i = left, j = right - 1;
            for ( ; ; ) {
                while ( arr[++i].compareTo( pivot ) < 0 ) ;
                while ( arr[--j].compareTo( pivot ) > 0 ) ;
                if ( i < j ) {
                    swapReferences( arr, i, j );
                } else {
                    break;
                }
            }
            
            //swap the pivot reference back to the small collection.
            swapReferences( arr, i, right - 1 );
            
            quicksort( arr, left, i - 1 );        //sort the small collection.
            quicksort( arr, i + 1, right );        //sort the large collection.
            
        } else {
            //if the total number is less than CUTOFF we use insertion sort instead.
            insertionSort( arr, left, right );
        }
    }
897706
public static <E extends Comparable<E>> void quickSort(InplaceList<E> array) {
    if (array.isEmpty()) {
      return;
    }
    recursiveQuickSort(array, 0, array.size() - 1);
  }
50140
public static void sort(short[] shortArray) {
        boolean swapped = true;
        
        while(swapped) {
            swapped = false;
            
            for(int i = 0; i < (shortArray.length - 1 ); i++) {
                if(shortArray[i] > shortArray[i + 1]) {
                    TrivialSwap.swap(shortArray, i, i + 1);
                    
                    swapped = true;
                }
            }            
        }
    }
609229
public static <V> V[] sort(V[] array, Comparator<? super V> comparator) {
        Arrays.sort(array, comparator);
        return array;
    }
875022
private static <T extends Comparable<? super T>> void heapify(T[] arr) {
        int n = arr.length;
        for (int i = n / 2 - 1; i >= 0; i--)
            SortUtils.siftDown(arr, i, n - 1);
    }
961461
public static <T> void sort(List<T> list, Comparator<? super T> comparator) {
		if (list instanceof RandomAccess) {
			quicksort(list, comparator);
		} else {
			List<T> copy = new ArrayList<>(list);
			quicksort(copy, comparator);
			list.clear();
			list.addAll(copy);
		}
	}
234579
public static <T extends Comparable<? super T>>
    void quickSelect( T[] arr, int k )
    {
        quickSelect( arr, 0, arr.length - 1, k );
    }
879999
public static void sort(float[] floatArray) {
        int index = 0;
        float value = 0f;
        
        for(int i = 1; i < floatArray.length; i++) {
            index = i;
            value = floatArray[index];
            
            while(index > 0 && value < floatArray[index - 1]) {
                floatArray[index] = floatArray[index - 1];
                
                index--;
            }
            
            floatArray[index] = value;
        }
    }
634154
public static <T> void shuffleArray(T[] arr) {
		for (int i = arr.length; i > 1; i--)
			swap(arr, i - 1, rand.nextInt(i));
	}
867235
function sort(array, compare) {
  if (array.length <= 1) {
    return array;
  }

  var i;
  var middle = Math.floor(array.length / 2);
  var left = new Array(middle);
  var right = new Array(array.length - middle);

  for (i = 0; i < left.length; i++) {
    left[i] = array[i];
  }
  for (i = 0; i < right.length; i++) {
    right[i] = array[i + left.length];
  }

  return merge(sort(left, compare), sort(right, compare), compare);
}
377814
public static <T extends Comparable<T>> Integer[] asort(T[] array) {
        return _asort(array, false);
    }
564932
public static <E extends Comparable<E>> void sort(E[] array) {
        int minIndex = 0;
        for(int i = 0; i < array.length; i++) {
            minIndex = i;
            
            for(int j = minIndex; j < array.length; j++) {
                if(array[j].compareTo(array[minIndex]) < 0) {
                    minIndex = j;
                }
            }
            TrivialSwap.swap(array, i, minIndex);
        }
    }
1352497
public static short[] intersectionSorted(short[]... arrs) {
		if (arrs.length == 0)
			return new short[0];
		if (arrs.length == 1)
			return arrs[0];

		short[][] arrList = new short[arrs.length - 1][];
		short[] minLengthArray = arrs[0];
		for (int i = 1; i < arrs.length; i++) {
			short[] arr = arrs[i];
			if (arr.length < minLengthArray.length) {
				arrList[i - 1] = minLengthArray;
				minLengthArray = arr;
			} else {
				arrList[i - 1] = arr;
			}
		}
		//
		// System.out.println("--");
		// System.out.println(Arrays.toString(minLengthArray));
		// for(short[] otherArr: arrList){
		// System.out.println(Arrays.toString(otherArr));
		// }
		// System.out.println("--");

		short[] pointer = ArrayUtils.createArray(arrs.length - 1, (short) 0);

		List<Short> commonIndices = new ArrayList<>(minLengthArray.length);
		for (short i = 0; i < minLengthArray.length; i++) {
			short stateIndex = minLengthArray[i];
			boolean insert = true;
			for (short j = 0; j < pointer.length; j++) {
				for (short k = pointer[j]; k < arrList[j].length; k++) {
					if (stateIndex < arrList[j][k]) {
						// Array does not contain the state-index
						break;
					} else if (stateIndex > arrList[j][k]) {
						if (k < arrList[j].length - 1) {
							pointer[j] = (short) (pointer[j] + 1);
						} else {
							break;
						}
					} else {
						break;
					}
				}
				if (arrList[j][pointer[j]] != stateIndex) {
					insert = false;
					break;
				}
			}
			if (insert) {
				commonIndices.add(stateIndex);
			}
		}

		short[] result = new short[commonIndices.size()];
		for (int l = 0; l < commonIndices.size(); l++) {
			result[l] = commonIndices.get(l);
		}
		return result;
	}
865277
function arrayIndexOfComparer(array, item, comparer) {
    for (var i = 0, len = array.length; i < len; i++) {
      if (comparer(array[i], item)) { return i; }
    }
    return -1;
  }
850405
public static <E extends Comparable<E>> void sort(E[] intArray) {
        Quicksort.sort(intArray, 0, intArray.length - 1 , false);
    }
594512
public static <T extends Comparable<? super T>> void sort (T[] a)
    {
        sort(a, 0, a.length - 1);
    }