In answers related to quicksort
vs mergesort
, it is commonly stated that quicksort
exploits cache locality (locality of reference) better than mergesort
.
As both sorts follow a divide and conquer approach, I don't understand how quicksort
is more cache-friendly. Can anyone provide more insight related to this?
Also, there's notes on in-place merge sort. If this is practical (I have no idea whether it is), can merge sort also be cache-friendly?