2012-05-04, 06:43 PM
happylight Wrote:Er no? With an array of all duplicates, their implementation would still run as fast as merge sort whereas yours would be as slow as selection sort.
Let's see.
Theirs does:
- n comparisons
- n/2 swaps
- (50<>50) split
- The total work done outside of the recursion is O(n), and they have logn number of recursion layers.
Mine does:
- n comparisons
- no swaps
- (1<>n-1) split
- The total work done outside of the recursion is O(n) -albeit with a lower coefficient-, and I have n-1 number of recursion layers.
Seems to be the case. I should somehow circumvent this.

