Apply your simple sorting algorithms (exchange sort,
insertion sort, and selection sort) to the data file provided and
answer questions about the number of comparisons and the number of
exchanges made by each algorithm.
For selection sort, do not swap
identical items.
The data file consists of 100,000
numbers.
1) How many comparisons are made when sorting the 100,000-element
list using Exchange Sort?
Note: Exchange Sort will require about a minute to sort this
list.
2) How many exchanges are made by Exchange Sort while sorting
this list?
3) How many comparisons are made by Insertion Sort while sorting
this list?
4) How many exchanges were made by Insertion Sort while sorting
this list?
5) How many comparisons are made by Selection Sort when sorting
this list?
Remember to make sure that you are not swapping identical items;
that will cost you some extra comparisons.
6) How many exchanges does Selection Sort perform while sorting
this list?
Remember, don't exchange identical items! There are a few in
this list.