python3 sorter.py [to get the usage statement]
python3 sorter.py bubble 10 verbose
python3 sorter.py insertion 1000
python3 sorter.py selection 1000
The goal of sorter.py is not to sort data that we care about. After all, it
just sorts a shuffled list of the integers 0 through N-1, and we already
know what that sorted list is supposed to look like. Rather,
the goal is to time the various algorithms for various sizes of N to learn
about the behavior of each algorithm as N increases. You can see the actual
data being sorted (before and after) by using the "verbose" option, but that's
annoying and pointless for N much larger than 10.
How does the speed of the available algorithms compare for N = 5000? Is there
a clear winner? A clear loser?
Try Selection Sort for N = 3000, 6000, 9000, 12000, 15000, 18000. Make a simple
graph of N (x-axis) versus Time (y-axis) on paper, or Excel if you know how to do
that already. What does the Time(N) function look like?
If you graph the comparison counts instead of the times, what does the curve look like?