glugglug is disappointed that this application only uses 1 CPU core. He thinks it should be multithreaded. Glugglug's X2 only reached a temperature of 93F (34C) while running this program.
Quick Sort 8.3531 Heap Sort 35.3188 Merge Sort 1.8563 Insertion Sort: flashed off the screen too quick to read (console window closed with application), it was about as fast as the merge, which makes glugglug fairly certain it is NOT doing an insertion sort. In fact, he thinks if you fix it so it DOES do an insertion sort, than on low memory bandwidth machines it will take DAYS to run.
glugglug also thinks that you should change line 127 to have a < instead of a <= and maybe change lines 135-136 to have <= and instead of < and that is part of why the quicksort is so much slower than the merge sort (they should be about the same).
hmm, glugglug just tried this, it seems to slow it down a litttle, he doesn't know why.
glugglug guesses you are running on a P4 and seeing lower latency from inclusive & lower "way-ness" L2 on the heap sort? (which will backfire if you increase the data set size)
Interestingly enough, running 1 on each core makes each one FASTER, I am thinking cool n' quiet was making it run at a lower clock rate with only 1 thread.
Quicksort times running 2 simultaneously: 4.6187/4.6755
Heapsort times: 13.2359/13.2516
Merge sort: 1.3156/1.3375
Insertion Sort: 1.1265/1.1969. (This time I got the press any key to continue thing so I could read it)
All while typing in this browser.
Overlap in time for execution of the 2 threads is not 100% but close.