I recommend that you use Perl sort() rather than trying to implement a my_sort() routine yourself.
Update: I skipped Perl 5.8 and went straight from 5.6 to 5.10. I know that the worst case quicksort issue (already ordered) went away. But more happened than just that. The sorting got significantly faster. Probably a combination of algorithm and implementation changes? I have not investigated all of the details. I just know that it is a lot faster. The sort time got so much better that it has caused me to re-think many places where I used techniques like Schwartzian transform.
As a learning exercise, I think one should be familiar with all the basic sorting algorithms. There is a lot to be learned from that and there is a reason why this is taught in every CS curriculum. I guess I just wound up with a very long winded way of saying: the Perl sort() function is no slouch!
In reply to Re: Quicksort problem
by Marshall
in thread Quicksort problem
by JediMasterT
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |