Python Arena

Module 60 Extra

Sorting algorithms

How sorting works, what each way costs, and how to use Python's own sort. Insertion sort, merge sort, quicksort and its partition, counting sort, `sorted` with keys and stability, and the k smallest values and the median without sorting everything.

Steps

  1. Insertion sort
  2. Merge sort
  3. Quicksort and partitioning
  4. Counting sort
  5. Python's sort: keys and stability
  6. The k smallest and the median