Lazy Selection Sort
Select the next smallest element on demand, avoiding full sorting until all elements are requested.
5 notes
Select the next smallest element on demand, avoiding full sorting until all elements are requested.
Use a tournament tree to extract the smallest or largest k elements in sorted order without fully sorting the input.
Rearrange a sequence so that the smallest k elements appear in sorted order, without fully sorting the entire sequence.
Select the k-th element by partially sorting only the needed prefix of the array.
Produce only the smallest k elements in sorted order rather than sorting the entire array, reducing unnecessary work when the full order is not needed.