Whatever the answer, check out Numerical Recipes (http://www.nr.com/).
http://apps.nrbook.com/rollover/index.html
http://en.wikipedia.org/wiki/Merge_sort
http://en.wikipedia.org/wiki/Heapsort
http://en.wikipedia.org/wiki/Quicksort
Whatever the answer, check out Numerical Recipes (http://www.nr.com/).