Watch sorting algorithms rearrange an array step by step. Scrub, step, and replay at your own pace.
Repeatedly swaps adjacent out-of-order pairs; the largest value bubbles to the end each pass.
Selects the smallest remaining element each pass and moves it into place.
Builds a sorted prefix by inserting each new element into its correct spot.
Recursively splits the array, then merges sorted halves back together. Stable, O(n log n).
Partitions around a pivot so smaller elements move left, then recurses on each side.