Divide-and-conquer sorts: merge sort variants, quicksort family, heapsort, and comparison-based sorting networks.
| index | slug | name |
|---|---|---|
| 181 | merge-sort | Merge Sort |
| 182 | top-down-merge-sort | Top Down Merge Sort |
| 183 | bottom-up-merge-sort | Bottom Up Merge Sort |
| 184 | natural-merge-sort | Natural Merge Sort |
| 185 | in-place-merge-sort | In Place Merge Sort |
| 186 | block-merge-sort | Block Merge Sort |
| 187 | timsort | Timsort |
| 188 | powersort | Powersort |
| 189 | quicksort | Quicksort |
| 190 | randomized-quicksort | Randomized Quicksort |
| 191 | three-way-quicksort | Three Way Quicksort |
| 192 | dual-pivot-quicksort | Dual Pivot Quicksort |
| 193 | introsort | Introsort |
| 194 | pdqsort | Pattern Defeating Quicksort |
| 195 | block-quicksort | Block Quicksort |
| 196 | stable-quicksort | Stable Quicksort |
| 197 | quicksort-median-of-three | Quicksort Median of Three |
| 198 | quicksort-ninther | Quicksort Ninther |
| 199 | quicksort-hoare-partition | Hoare Partition Quicksort |
| 200 | quicksort-lomuto-partition | Lomuto Partition Quicksort |
| 201 | heapsort | Heapsort |
| 202 | bottom-up-heapsort | Bottom Up Heapsort |
| 203 | ternary-heapsort | Ternary Heapsort |
| 204 | weak-heapsort | Weak Heapsort |
| 205 | merge-insertion-sort | Merge Insertion Sort |
| 206 | ford-johnson-sort | Ford Johnson Sort |
| 207 | bitonic-sort | Bitonic Sort |
| 208 | odd-even-merge-sort | Odd Even Merge Sort |
| 209 | pairwise-sorting-network | Pairwise Sorting Network |
| 210 | batcher-merge-sort | Batcher Merge Sort |
| 211 | akra-bazzi-merge-sort-variant | Akra Bazzi Merge Sort Variant |
| 212 | cache-oblivious-merge-sort | Cache Oblivious Merge Sort |
| 213 | sample-sort | Sample Sort |
| 214 | multiway-merge-sort | Multiway Merge Sort |
| 215 | tournament-merge-sort | Tournament Merge Sort |
Merge SortDivide and conquer sorting algorithm that splits the array, sorts recursively, and merges in linear time.
Top Down Merge SortRecursive merge sort that splits the array from the top and merges sorted halves.
Bottom Up Merge SortIterative merge sort that builds sorted runs from size 1 upward without recursion.
Natural Merge SortAdaptive merge sort that detects existing sorted runs and merges them.
In Place Merge SortMerge sort variant that reduces auxiliary memory by merging sorted ranges inside the original array.
Block Merge SortStable merge sort variant that uses block rearrangement and a small buffer to reduce auxiliary memory.
TimsortAdaptive stable sorting algorithm that combines merge sort with run detection and insertion sort.
PowersortStable adaptive merge sort that uses power based ordering of runs for near optimal merging.
QuicksortDivide and conquer sorting algorithm that partitions the array around a pivot and recursively sorts both sides.
Randomized QuicksortQuicksort variant that selects pivots randomly to avoid worst case patterns.
Three Way QuicksortQuicksort variant that partitions into less than, equal to, and greater than pivot.
Dual Pivot QuicksortQuicksort variant that partitions the array using two pivots into three regions.
IntrosortHybrid sorting algorithm that starts with quicksort and falls back to heapsort when recursion becomes too deep.
Pattern Defeating QuicksortQuicksort variant that detects and avoids bad input patterns using adaptive partitioning and pivot selection.
Block QuicksortQuicksort variant that processes elements in blocks to reduce branch misprediction and improve cache efficiency.
Stable QuicksortQuicksort variant that preserves the relative order of equal elements.
Quicksort Median of ThreeQuicksort variant that chooses the pivot as the median of the first, middle, and last elements.
Quicksort NintherQuicksort variant that selects the pivot using Tukey's ninther, the median of three medians of three.
Hoare Partition QuicksortQuicksort variant that uses Hoare's two pointer partition scheme.
Lomuto Partition QuicksortQuicksort variant using the Lomuto single-index partition scheme.
HeapsortComparison sorting algorithm that builds a heap and repeatedly extracts the maximum.
Bottom Up HeapsortHeapsort variant that uses bottom up sift down to reduce comparisons during heapify.
Ternary HeapsortHeapsort variant that uses a ternary heap with three children per node.
Weak HeapsortHeapsort variant based on weak heaps, reducing the number of comparisons while retaining in-place sorting.
Merge Insertion SortComparison-optimal sorting algorithm that combines merging and insertion guided by a structured schedule.
Ford Johnson SortComparison optimal sorting algorithm that minimizes comparisons using a structured insertion schedule.
Bitonic SortComparison sorting algorithm that sorts a bitonic sequence using structured compare and swap operations.
Odd Even Merge SortSorting network algorithm that recursively merges sorted sequences using odd even comparisons.
Pairwise Sorting NetworkSorting network that sorts by repeatedly applying pairwise compare and swap stages.
Batcher Merge SortSorting network algorithm based on recursively sorting halves and merging them with Batcher's odd even merge network.
Cache Efficient Merge SortMerge sort variant designed to improve cache locality by structuring recursion and merging to fit memory hierarchies.
Cache Oblivious Merge SortMerge sort variant that improves locality without tuning parameters for a specific cache size.
Sample SortDivide and conquer sorting algorithm that uses sampling to partition data into balanced buckets.
Multiway Merge SortMerge sort variant that merges more than two sorted sequences at each step.
Tournament Merge SortMerge-based sorting algorithm that uses a tournament tree to repeatedly select the next smallest element.