LeetCode 912: Sort an Array
A clear explanation of sorting an array without built-in sorting using merge sort.
27 notes
A clear explanation of sorting an array without built-in sorting using merge sort.
A clear explanation of counting pairs where nums[i] is greater than twice nums[j] using merge sort.
A clear explanation of Count of Range Sum using prefix sums and merge sort counting.
A clear explanation of Count of Smaller Numbers After Self using coordinate compression and a Fenwick Tree.
Sort a singly linked list in ascending order using merge sort with fast and slow pointers.
Sort data on a GPU by recursively merging sorted runs using parallel merge primitives.
Divide the input, sort subarrays in parallel, then merge them using parallel merge procedures.
External sorting algorithm that distributes sorted runs across sequential storage tapes and repeatedly merges them.
External sorting method that merges sorted runs through staged levels so output from one level feeds the next.
External sorting algorithm that repeatedly merges groups of k sorted runs until one final sorted run remains.
External sorting algorithm that distributes sorted runs unevenly across files so repeated merges need fewer empty files and less redistribution.
Sort data that does not fit in memory by dividing it into sorted runs and merging them using external storage.
An adaptive merge-based sorting algorithm that merges natural runs using stack rules designed to minimize merge cost.
Sort a sequence by detecting already sorted runs and repeatedly merging them.
A merge sort variant that exploits existing order in the input by detecting natural runs and reducing work.
Merge-based sorting algorithm that uses a tournament tree to repeatedly select the next smallest element.
Merge sort variant that merges more than two sorted sequences at each step.
Merge sort variant that improves locality without tuning parameters for a specific cache size.
Merge sort variant designed to improve cache locality by structuring recursion and merging to fit memory hierarchies.
Stable merge sort variant that uses block rearrangement and a small buffer to reduce auxiliary memory.
Merge sort variant that reduces auxiliary memory by merging sorted ranges inside the original array.
Adaptive merge sort that detects existing sorted runs and merges them.
Iterative merge sort that builds sorted runs from size 1 upward without recursion.
Recursive merge sort that splits the array from the top and merges sorted halves.
Divide and conquer sorting algorithm that splits the array, sorts recursively, and merges in linear time.
Count pairs of elements in the wrong relative order to measure how far an array is from sorted, using a modified merge sort in O(n log n) time.
Divide the input into halves, recursively sort each half, then merge them — combining local order into global order in O(n log n) time.