Sort the short array in ascending order using this algorithm.

@param shortArray the array of shorts that we want to sort
554138
public static void sort(short[] shortArray) {
        int index = 0;
        short value = 0;
        
        for(int i = 1; i < shortArray.length; i++) {
            index = i;
            value = shortArray[index];
            
            while(index > 0 && value < shortArray[index - 1]) {
                shortArray[index] = shortArray[index - 1];
                
                index--;
            }
            
            shortArray[index] = value;
        }
    }
1037828
public synchronized void reset(short[] shortArray) throws IOException {
      _writer.flush();
      _writer.position(DATA_START_POSITION);
      for(int i = 0; i < shortArray.length; i++) {
          _writer.writeShort(shortArray[i]);
      }
      _writer.flush();
  }
1147584
public static int searchDescending(short[] shortArray, short value) { 
        int start = 0;
        int end = shortArray.length - 1;
        int middle = 0;
        
        while(start <= end) {
            middle = (start + end) >> 1;
        
            if(value == shortArray[middle]) {
                return middle;
            }
            
            if(value > shortArray[middle]) {
                end = middle - 1 ;
            }
            else {
                start = middle + 1;
            }
        }
                

        return -1;
    }
165
@SuppressWarnings("unchecked")
	public <T> void sort(Arr arr, Comparator<T> c) {
		int l = arr.getLength();
		Object[] objs = new Object[l];
		for (int i=0; i<l; i++) {
			objs[i] = arr.get(i);
		}
		Arrays.sort((T[])objs, c);
		for (int i=0; i<l; i++) {
			arr.put(i, objs[i]);
		}
	}
291928
public static void quickSort(double[] arrayToSort, double[] linkedArray, int left, int right) {
    if (left < right) {
      int middle = partition(arrayToSort, linkedArray, left, right);
      quickSort(arrayToSort, linkedArray, left, middle);
      quickSort(arrayToSort, linkedArray, middle + 1, right);
    }
  }
1346504
public short[] extractShortArray() {
	short[] argout;
	argout = new short[values.length];
	for (int i = 0; i < values.length; i++) {
	    argout[i] = Short.parseShort(values[i]);
	}
	return argout;
    }
1281977
public static boolean containSameElementsSorted(short[]... arrs) {
		Validate.notNull(arrs);
		if (arrs.length == 1)
			return true;

		int firstSize = arrs[0].length;
		for (int i = 1; i < arrs.length; i++) {
			if (arrs[i].length != firstSize) {
				return false;
			}
		}

		for (int j = 0; j < firstSize; j++) {
			short firstValue = arrs[0][j];
			for (int k = 1; k < arrs.length; k++) {
				if (arrs[k][j] != firstValue)
					return false;
			}
		}
		return true;
	}
1177682
public static void sort(int[] arr) {
        int n = arr.length;
        for (int i = n / 2 - 1; i >= 0; i--)
            SortUtils.siftDown(arr, i, n - 1);

        for (int i = n - 1; i > 0; i--) {
            SortUtils.swap(arr, 0, i);
            SortUtils.siftDown(arr, 0, i - 1);
        }
    }
563485
public static <E extends Comparable<E>> void quickSort(List<E> array) {
    if (array.isEmpty()) {
      return;
    }
    recursiveQuickSort(array, 0, array.size() - 1);
  }
1368527
public static <E extends Comparable<E>> void sortDescending(E[] intArray) {
        Merge.sort(intArray, 0, intArray.length-1, true);
    }
344076
public static void sort(double[] doubleArray) {
        int index = 0;
        double value = 0.0;
        
        for(int i = 1; i < doubleArray.length; i++) {
            index = i;
            value = doubleArray[index];
            
            while(index > 0 && value < doubleArray[index - 1]) {
                doubleArray[index] = doubleArray[index - 1];
                
                index--;
            }
            
            doubleArray[index] = value;
        }
    }
671687
private void selectionSort(final T[] array, int start, int end, Comparator<T> lt) {
    int i;
    int j;
    int bestI;
    T tmp;
    for (i = start; i < end; i++) {
      bestI = i;
      for (j = i + 1; j < end; j++) {
        if (lt.compare(array[j], array[bestI]) < 0)
          bestI = j;
      }
      tmp = array[i];
      array[i] = array[bestI];
      array[bestI] = tmp;
    }
  }
1212855
public static void sortDescending(char[] charArray) {
        int index = 0;
        char value = 0;
        
        for(int i = 1; i < charArray.length; i++) {
            index = i;
            value = charArray[index];
            
            while(index > 0 && value > charArray[index - 1]) {
                charArray[index] = charArray[index - 1];
                
                index--;
            }
            
            charArray[index] = value;
        }
    }
1086009
public static void sort(int[] intArray) {
        int minIndex = 0;
        for(int i = 0; i < intArray.length; i++) {
            minIndex = i;
            
            for(int j = minIndex; j < intArray.length; j++) {
                if(intArray[j] < intArray[minIndex]) {
                    minIndex = j;
                }
            }
            XORSwap.swap(intArray, i, minIndex);
        }
    }
37283
public void sort() {
        if (!sorted) {
            sort(heap, Math.min(k,n));
            sorted = true;
        }
    }
1229928
public static void sort(long[] longArray) {
        boolean swapped = true;
        
        while(swapped) {
            swapped = false;
            
            for(int i = 0; i < (longArray.length - 1 ); i++) {
                if(longArray[i] > longArray[i + 1]) {
                    TrivialSwap.swap(longArray, i, i + 1);
                    
                    swapped = true;
                }
            }            
        }
    }
538310
public static void sortDescending(double[] doubleArray) {
        int index = 0;
        double value = 0;
        
        for(int i = 1; i < doubleArray.length; i++) {
            index = i;
            value = doubleArray[index];
            
            while(index > 0 && value > doubleArray[index - 1]) {
                doubleArray[index] = doubleArray[index - 1];
                
                index--;
            }
            
            doubleArray[index] = value;
        }
    }