February 2014
Beginner
1248 pages
62h 25m
English
Class SelectionSortTest (Fig. 19.4) contains:
• static method selectionSort to sort an int array using the selection sort algorithm
• static method swap to swap the values of two array elements
• static method printPass to display the array contents after each pass, and
• main to test method selectionSort.
As in the searching examples, main (lines 57–72) creates an array of ints named data and populates it with random ints in the range 10–99. Line 68 tests method selectionSort.
Read now
Unlock full access