Explanations, pseudocode, an embedded interactive visualization, implementations in JavaScript, Python, Java and Go, complexity and interview variations.
Repeatedly compares adjacent elements and swaps them when they are out of order, so the largest unsorted value bubbles to the end after every pass.
Divides the array into a sorted prefix and an unsorted suffix. Each pass selects the minimum of the unsorted part and swaps it into the next position of the prefix.
Builds a sorted prefix one element at a time: the next element (the key) is lifted out, larger elements of the prefix shift one step right, and the key drops into the gap.
Divide the array in halves, sort each recursively, merge the sorted halves.
Partition around a pivot, then sort both sides recursively.
Build a max-heap, then repeatedly move the maximum to the end.
Count occurrences of each key in a small integer range.
Stable sort digit by digit, least significant first.