2 ms·
Wouldn't it be faster to run built-in sort on each 1/8 of array, than each 1/4, 1/2 and the whole array in the end? Does Array.sort run much faster when the ar
by scotty79 11y ago
Wouldn't it be faster to run built-in sort on each 1/8 of array, than each 1/4, 1/2 and the whole array in the end?
Does Array.sort run much faster when the array already has some order?
EDIT: It doesn't. Sorting even totally sorted array takes as much as sorting shuffled array.