|
CSIS 250 Fall 2000 Project #5
Develop the bubbleSort function and support functions (swap, populate, display) for an array of integers with a main program in C++. The sort function should keep track of the counts used to measure the efforts required by it due to the following actions: § Assignment § Compare § Add § Increase § Any other operation The main program should test lists of sizes 10, 20, 30, 40, and 50. Submit the printed algorithms, source code, output, and the self-evaluation sheet. You can use the following algorithm for the main driver as a guide.
do the following for n=10 to 50 step 10 populate a[0..n-1] with n random values Initialize count to zero display “original”, n, count, a[0..n-1] bubbleSort(a, n) display “sorted”, n, count, a[0..n-1] end do
|