Created
February 15, 2013 06:42
-
-
Save vaskoz/4958867 to your computer and use it in GitHub Desktop.
Thresholds of DualPivotQuicksort
This file contains hidden or 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
/** | |
* If the length of an array to be sorted is less than this | |
* constant, Quicksort is used in preference to merge sort. | |
*/ | |
private static final int QUICKSORT_THRESHOLD = 286; | |
/** | |
* If the length of an array to be sorted is less than this | |
* constant, insertion sort is used in preference to Quicksort. | |
*/ | |
private static final int INSERTION_SORT_THRESHOLD = 47; | |
/** | |
* If the length of a byte array to be sorted is greater than this | |
* constant, counting sort is used in preference to insertion sort. | |
*/ | |
private static final int COUNTING_SORT_THRESHOLD_FOR_BYTE = 29; | |
/** | |
* If the length of a short or char array to be sorted is greater | |
* than this constant, counting sort is used in preference to Quicksort. | |
*/ | |
private static final int COUNTING_SORT_THRESHOLD_FOR_SHORT_OR_CHAR = 3200; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment