Why would you teach anyone how not to do something?
Umm. To explain strengths and weaknesses? To explain how to optimize something that already fulfills requirements but isn’t efficient? To make a design trade off that the simpler algorithm is sometimes good enough?
IMO, the introductory algorithm to sorting is Selection sort.
Selection sort introduces state and is therefore way more complicated to explain.
And why do you think it's more complicated to explain? It is literally how a fourth grader would approach sorting a list of numbers, it is how you would sort the money in your wallet, it is the default human way of thinking.
1
u/chucker23n Dec 03 '19
Umm. To explain strengths and weaknesses? To explain how to optimize something that already fulfills requirements but isn’t efficient? To make a design trade off that the simpler algorithm is sometimes good enough?
Selection sort introduces state and is therefore way more complicated to explain.