Re: QuickSort
Re: QuickSort
- Subject: Re: QuickSort
- From: Graff <email@hidden>
- Date: Wed, 14 Jul 2004 18:56:31 -0400
Quicksort is potentially the fastest sort out there for large,
completely unordered data sets. If the data is semi-ordered then a
quicksort can be sub-optimal.
(<
http://www.mathcs.carleton.edu/courses/course_resources/cs227_w96/
swanjorg/algosort.html>)
Bubblesort is pretty slow but it is simple to implement and understand.
The unix sort shell tool works well but it can be a pain to use,
especially with large sorts.
I don't know much about the perldoc sort.
For AppleScript sorts I would use a bubblesort if you are sorting up to
1000 items or so. At that amount of objects speed really isn't much of
a factor. For 1,000 to 100,000 items I'd use one of the quicksort
algorithms - preferably a modified quicksort (known as an introsort)
that resorts to a heapsort for the final stages of sorting.
For anything more than 100,000 items I'd turn to a different
programming language. For example, C has a nice built-in quicksort
that is very customizable and you can generally get a C program to run
many times faster than an AppleScript one.
- Ken
On Jul 14, 2004, at 11:36 AM, Bernard Azancot wrote:
I have been spending a lot of time, looking for sorting routines in
good old jurassic web pages contributions (2002 !!).
QuickSort by
Serge Belleudy-d'Espinose
Arthur J Knapp
Steve Roy
Nigel Garvey
HAS
AK...
Bubblesort
Sort lists in AppleScript using the Unix sort command
Perl sort (perldoc sort)
Among all those contributions what could be the best one in actual
MacOSX environnement ?
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.
References: | |
| >QuickSort (From: Bernard Azancot <email@hidden>) |