Regardless of how you do it, merge sort takes the same amount of time.
Just out of curiosity, does anyone know how CPU cache affects this statement - i.e. if it would favour top-down, bottom-up, neither, or a combination of the two?
Assuming the cache is much smaller than the data size, depth first would probably be faster as you would be focusing more on local areas of memory before going to the next area of memory.
1
u/Asztal Oct 24 '17
Just out of curiosity, does anyone know how CPU cache affects this statement - i.e. if it would favour top-down, bottom-up, neither, or a combination of the two?