public static void exchange(int[] array,int i,int j){     //exchange 2 elements array[i] and array[j]; i and j is the index of the array.   
		if(j!=i){
			int temp = array[i];
			array[i] = array[j];
			array[j] = temp;
		}
	}