Sorting a list of records
Sorting a list of records
- Subject: Sorting a list of records
- From: Gil Dawson <email@hidden>
- Date: Mon, 23 Aug 2010 15:58:41 -0700
Hi, Folks--
I need an algorithm to sort a list of records in a "stable" way. By "stable", I mean
When two keys are equal, output records are in the same order as the input.
The AppleScript 'CustomQsort' algorithm suggested by Adam Bell, Nigel Garvey, et al in (http://macscripter.net/viewtopic.php?id=17340) works well in my application except that the underlying QuickSort algorithm is intrinsically not "stable".
I looked at the "sortlist" command in Satimage.osax. It is stable, but it sorts a list of lists, instead of a list of records. I would need to figure a way to "coerce" a list of records to a list of lists, then back again.
Anyone have another idea?
--Gil _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden