public <T extends Comparable<T>> int selectionSort(T[] array) {
	  currentCompares = 0;
    int N = array.length;
    for (int i = 0; i < N; i++) {
    	int min = i;
    	for (int j = i+1; j < N; j++) {
    		if (less(array[j], array[min])) min = j;
    	}
    	exch(array, i, min);
    }
    return currentCompares;
  }