Quicksort lesson
Quicksort is an efficient way to sort things by breaking the problem down into smaller parts. You start by picking a “pivot” card. This can be any card, but choosing one near the middle usually works out better. Then, go through the rest of the cards and place the ones that are less than the pivot on the left, and the ones that are greater than the pivot on the right. Make sure to treat those left and right piles like brand-new problems and repeat the process. Pick a new pivot for each side, split again, and keep going until each pile is either just one card or already sorted. To illustrate this with playing cards, lay out a messy row of cards face up, pick a pivot, and physically move cards to the left or right depending on their value. Continue repeating this process for the left and right piles until the entire arrangement is in order. It’s a cool visual way to see a sorting algorithm in action.