为什么在所有n> = 2的nlogn小于n ^ 2的情况下,Java在Arrays类中使用了47的INSERTION_SORT_THRESHOLD?它与硬件恒定开销有关系吗?
private static void sort(int[] a, int left, int right, boolean leftmost) {
int length = right - left + 1;
// Use insertion sort on tiny arrays
if (length < INSERTION_SORT_THRESHOLD) {
if (leftmost) {
/*
* Traditional (without sentinel) insertion sort,
* optimized for server VM, is used in case of
* the leftmost part.
*/
for (int i = left, j = i; i < right; j = ++i) {