I was working on implementing a quicksort yesterday, and then I ran it, expecting a faster runtime than the Mergesort (which I had also implemented). I ran the two, and while th
Based on this wikipedia article your results are expected.
For good performance of quicksort, it is important not to recurse all the way down to lists of length 1
You should consider sorting lists of 2, 3 and even 4 as nested ifs swapping if necessary. Let us know how the performance changes.
Were you datasets random enough? Were they partially sorted?
That might affect the speed of the sort...
Like for the QuickSort's partition(), you'd skip along if the numbers are in sorted order, until you find one that's not.