-
-
Notifications
You must be signed in to change notification settings - Fork 769
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
O(n) sorting for selection markers: sort_selection()
QuickSort produces O(nlog n) at best and O(n^2) at worst. Sort selection markers with a trivial radix sort algorithm, which guarantees O(n) time. As a consequence both time and space consumption will be linear. Do not generalize the algorithm, as other sites most likely require a comparison based sorting algorithm. For those sites the goal should be to eliminate the worst case O(n^2) and have a steady O(nlog n) performance. Signed-off-by: Jarkko Sakkinen <[email protected]>
- Loading branch information
Showing
1 changed file
with
40 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters