Week 8 - Sorting Algorithms (Friday)
Learning Materials
Sort Efficiency
First of all, we want to consider, what is the Big-Oh notation for each of these three sorts.
- Watch - Eye-Balling: Looking at the big-Oh of these sorts (Video, 8 minutes)
- Watch - Formal Timing: Looking at the Big-Oh of these sorts (Video, 9 minutes)
You Try It #3
- Consider how the structure of the data effects the sort time.
- If you like, get together with a partner.
- Revise the timerComparison.py file above so that you:
- Get the baseline - Test each of the three sorts with truly random data (leave the shuffle)
- Test each of the three sorts with already sorted data (remove the shuffle)
- Test each of the three sorts with "reverse-order" data (rather than shuffle, reverse the order)
- Run each set of data several times and with different N values (rather than always 3000 items, try some other values).
- Record and discuss your results
Watch: My video walkthrough of this (Video, 9 minutes)