home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!uunet.ca!geac!torag!zooid!ron
- From: ron@zooid.guild.org (Secret Mud)
- Newsgroups: rec.games.programmer
- Subject: Re: Advice needed for fastest sort algorthm
- Message-ID: <721929737.12971@zooid.guild.org>
- Date: 16 Nov 92 16:02:17 GMT
- Lines: 18
-
- From: roberts@angelo.amd.com (Dave Roberts)
- >
- >My post was a knee jerk response that bubble sort is bad. It's not.
- >Used wisely and carefully chosen, it's a beautiful thing. I just hate
- >it when people automatically think that quicksort is the be-all
- >end-all sort of the millenium.
- >
- >You can now safely interview since you correctly recalled that bubble
- >is n*n. :-)
- >
-
- A trivial mod to bubble sort can reduce the worst case to n*n/2. The main
- thing is what is the sort being used for, and just how important speed is. If
- it's a sort of an object list of max 20 objects, and it's mostly sorted
- already, then throw in a bubble sort and move on to the real programming
- problems.
-
- - Ron Sharp.
-