Has anybody ever built there own sort function before without using the in built sort command. If anyone has would it be possible to get a look at te code for it.
While you can, it's not really worthwhile. You can search the net for the various sorting algorithms if you're interrested in the theory. In Perl, when you need to do a complicated sort, you can create custom sort subs or generate packed sort fields, which is incredibly powerful, without bothering with the run-of-the-mill sorting algorithms. You get to more actual work rather than spending time on proven theory. Perl's sort function uses a merge sort, so there's little reason to not use it. On top of everything else, sort's merge sort is defined in C, so it executes much faster than anything you could create in Perl alone.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.