[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Sorting Algorythms
On Tuesday, December 18, 2012 7:09:19 PM UTC-6, gid...@sasktel.net wrote:
> I am sure everyone has dabbled in and programmed a sorting algorythm at some time while playing on their Apple II computer.
>
>
>
> What I would like to know is there any programs out there other than the usual talked about ones or one they may have created themselves?
>
>
>
> Bubble sort, Bi-bubble sort, Shell Metzner sort, Quick Sort, Field Sort, Binary search sort, Heap sort, Interchange sort.
>
>
>
>
>
> And what is the fastest sort anyone has come across. Is Quicksort the fastest?
>
> I re-engineered a sort that I came across, but I do not know the name of it, that is about 35% faster than the quicksort. With the added advantage of leaving the original in tact as well as have multiple tag alongs and it sorts numbers properly where the number 2 is less than 10. Most sorts will not sort numbers properly.
>
>
>
> Rob
Academically speaking, QuickSort is the fastest general-purpose algorithm for moderate-to-large data sets. For smaller sets (say, a few dozen) shell sort is almost equivalent in terms of speed. If you're really tight on code space, nothing is smaller than bubble sort. Even bubble sort is ok for small sets.
The wikipedia article on sorting algorithms does a great job comparing the pros and cons of each. Really the worst you can do is implement BogoSort.
-B