/** Test InsertionIndex.sort() on given array */
 public void testSelectionSort(int[] arr) {
   System.out.println(String.format("Selection sort on input: %s", Arrays.toString(arr)));
   SelectionSort.sort(arr);
   System.out.println(String.format("Result: %s", Arrays.toString(arr)));
   System.out.println();
   assertTrue(TestUtil.isArraySorted(arr));
 }
Пример #2
0
 @Test
 public void testSelectionSort() {
   List<Integer> list = getRandomUnsortedList();
   testSort(list, SelectionSort.sort(list));
 }