Watch arrays get ordered — comparisons, swaps, and partitions animated step by step.
32 visualizations
Repeatedly swaps adjacent out-of-order elements, bubbling the largest to the end each pass.
Repeatedly selects the smallest remaining element and moves it to the front, using at most n−1 swaps.
Builds a sorted prefix one element at a time, shifting larger elements right to open a slot for each key.
Recursively splits the array in half, sorts each half, then merges them — guaranteed O(n log n).
Partitions around a pivot so smaller elements go left and larger go right, then recurses on each side.
Builds a max-heap in the array, then repeatedly swaps the root maximum to the end and re-heapifies.
Generalizes insertion sort by comparing elements a shrinking gap apart, moving them long distances early.
Counts occurrences of each key and uses prefix sums to place elements directly — O(n + k), no comparisons.
Sorts integers digit by digit from least to most significant, using a stable bucket pass for each digit.
A bidirectional bubble sort that alternates forward and backward passes, sorting from both ends inward.
Improves bubble sort by comparing elements a shrinking gap apart, eliminating small trailing values fast.
Scatters values into range-based buckets, sorts each bucket internally, then concatenates — fast when input is uniformly distributed.
The hybrid behind Python's and Java's default sort: insertion-sort small runs, then merge them like merge sort — stable and fast on partially-sorted data.
Sorts using only 'flip the first k elements' operations — find the max, flip it to the front, then flip it to its final position.
Places values by final rank and rotates permutation cycles, minimizing array writes.
Walks forward through ordered neighbors and backward after swapping an inversion.
Alternates odd-indexed and even-indexed adjacent compare-exchange phases.
Builds bitonic sequences and merges them through a fixed parallel compare-exchange network.
Uses quicksort until depth becomes risky, then falls back to heap sort and handles small ranges by insertion sort.
Builds a BST and emits its keys in order, including duplicate counts.
Uses binary search to locate each insertion point, then shifts the sorted prefix.
Recursively sorts the first two-thirds, last two-thirds, then first two-thirds again.
Extracts increasing strands from the input and merges them into a sorted output.
Builds patience piles and repeatedly extracts the minimum visible pile top.
Runs a comparison tournament to select each successive minimum.
Builds a forest of Leonardo max-heaps and dismantles it from the maximum end.
Sorts small blocks, then merges adjacent sorted blocks at doubling widths.
Counts every integer in a direct range-indexed pigeonhole and reads the holes in order.
Performs in-place MSD radix distribution with cycle leaders, then recurses into digit buckets.
Represents nonnegative integers as bead rows and applies gravity column by column.
Maintains sorted items on a gapped shelf and periodically redistributes them to restore insertion space.
Recursively distributes integers by their numeric spread and insertion-sorts small buckets.