Three algorithms. Same data. Which wins?
Year 9 Computer Science — Sorting Algorithms
You have 10 shuffled numbered cards.
Sort them in order. 30 seconds. GO.
What method did you use?
Was it the same across all groups?
Today: we'll compare 3 specific, mechanical algorithms.
Use the Algorithm Reference Card — follow it exactly!
Shuffle your cards to the starting order.
Follow the reference card step by step.
Count every comparison and every swap on the tally sheet.
Complete all passes until no swaps happen in a full pass.
Re-shuffle to the same starting order.
Follow the Selection Sort rules on the reference card.
Count comparisons and swaps.
Note: Selection Sort always makes exactly n−1 selections and at most n−1 swaps.
Re-shuffle to the same starting order again.
Follow the Insertion Sort rules.
Count comparisons and shifts/swaps.
Watch: what happens with a card that's already in the right place?
Fill in the summary table on your worksheet.
Compare across the class:
Try a nearly-sorted starting order: 1,2,3,4,6,5,7,8,9,10
Which algorithm handles this most efficiently?
Try reverse-sorted: 10,9,8,7,6,5,4,3,2,1
Which is now worst?