QUOTE(The Architect 2.0 @ 3 Jul, 2008 - 09:09 PM)

can someone explain the difference between quicksort and mergesort to me?
they both seem identical, with the only difference between them that mergesort divides exactly at the middle element, whereas quicksort attempts to pick the 'true' median element.
also, from what i've read, it is 'expected' that mergesort keep on dividing till there are n lists of 1 element, whereas quicksort alternatively CAN divide until its sublists reach a certain length(or a certain recursive height has been reached), at which point another [linear(?)] sorting algorithm would be used
Mergesort is bottom-up, while quick-sort is top-down. Even though you might see the term top-down associated with a particular implementation of mergesort, a merge sort works on that if you have two ordered lists, combining them to get a larger sorted list involves a simple comparison of the head element of each list, until each sublist has been processed. Since a merge requires the lists to be ordered, merges must be applied to sublists of increasing size.
Quicksort is applied on the entire list first, then each sublist (opposite of merge sort). If I have element X, and I place all elements less than X before it, and everything else after, then X will be in it's final position at the end of the sort. After all, nothing on the one side could ever be put on the other side, as they're all less than X.
There's no reason why you couldn't apply a linear sort in combination with a merge sort. It's just that there's little incentive to do so. With quicksort, optimal performance is obtained by selecting the optimal partition element (a.k.a. X). If X is always the least or greatest element in the list, then performance becomes more like O(N**2). There are ways around it, and one of them is the introsort algorithm (a quicksort that changes to a heapsort when the recursion depth exceeds a threshold).