15.4 Programming Activity: Tracking How Many Statements Are Executed by a Method
In this activity, you will work with a variable-size integer array. Specifically, you will perform the following operations:
Write code to keep track of the number of statement executions during a selection sort.
Run a simulation to compute the number of statements executed as a function of the number of elements in the array.
Estimate the running time of Selection Sort as a function of n, the number of elements in the array being sorted.
The framework for this Programming Activity will animate your algorithm so that you can perform a simulation on the number of statement executions inside the selectionSort method compared to the number of elements in the array ...
Get Java Illuminated, 5th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.