CIS 068 / 2: Lab-Assignment #8: Comparison of Selection and Bubble Sort

Write a program that will help you compare the two sorting algorithms selection and bubble sort with regard to the number of compares and number of record moves.


Please implement Bubble Sort and Selection Sort as separate classes. You may use the sources given in the textbook or any source you find in the web. In order to compare the algorithms, your classes must provide a variable to count the key-steps of each algorithm, which are:


Now write a program 'SortComparison' that compares the algorithms:


Example:
Assume the following result lists:
Bubble Sort: 34 56 89 98 ...
Selection Sort: 12 14 37 99 ...

The top 100 will then start like:
12 Selection
14 Selection
34 Bubble
37 Selection
56 Bubble
...


Total Score: 10 points


Go for a bonus point by adding Quick-Sort to the competition ! Again you may use the source of the textbook !

Good luck !