Content deleted Content added
→Data structure-based solutions: O((n + k) log k) = O(n log k), and don't address the reader as "you"; wants citation and clarification for the second suggestion |
→Data structure-based solutions: remove last suggestion, which appears to solve a wholly different problem (selection in a stream, not partial sorting) |
||
Line 12:
It is possible to transform the list into a [[binary heap]] in Θ(''n'') time, and then traverse the heap using a modified [[breadth-first search]] algorithm that places the elements in a [[priority queue]]{{clarify|reason=a heap is a priority queue!}} (instead of the ordinary queue that is normally used in a BFS), and terminate the scan after traversing exactly ''k'' elements. As the queue size remains O(''k'') throughout the traversal, it would require O(''k'' log ''k'') time to complete, leading to a time bound of O(''n'' + ''k'' log ''k'') on this algorithm.{{citation needed}}
== Optimised sorting algorithms ==
|