
15.4 Programming Activity:Tracking How Many Statements are Executed by a Method 1137
arr[indexOfMax] = arr[arr.length – i – 1];
arr[arr.length – i – 1] = temp;
}
return 0;
} // end of selectionSort
EXAMPLE 15.6 Location of Student Code in RunningTimePractice
Our framework will animate your algorithm so that you can watch your
code work. If you want to accelerate or slow down the animation, modify
the argument of Pause.wait in the animate method.
To test your code, compile and run the RunningTimePractice source code.
When the program begins, you will be prompted for the number of ele-
ments in the array. Because the values of the array are randomly generated, ...