Re: how to do a proper alphabetical sort?
Re: how to do a proper alphabetical sort?
- Subject: Re: how to do a proper alphabetical sort?
- From: Stan Cleveland <email@hidden>
- Date: Fri, 09 Mar 2007 16:12:17 -0800
- Thread-topic: how to do a proper alphabetical sort?
On 3/9/07 2:39 PM, Nigel Garvey wrote:
> Coincidentally, I did the very same thing a couple of weeks ago, but
> reworked it for "in place" operation. (It sorts the actual list passed to
> it rather than returning a sorted copy.) Instead of creating left and
> right listsĀ at each recursion level and shaving bits off while merging
> them (which produces yet more lists), it makes one copy of each entire
> section and uses left and right pointers to merge the items back into the
> original list. Not quite as fast as the qsort that Arthur Knapp and I
> wrote a few years ago, but not bad.
>
> <snip>
Nigel,
Suppose we sort the following list using your nifty mergesort handler:
{"blah", "BLAH", "Blah", "bLAH"}
The list is returned unchanged, presumably because every value is equivalent
when ignoring capitalization. By that logic, ANY arrangement of those four
strings is to be considered sorted.
My question is whether that's correct. Or should differently-cased strings
that are otherwise identical have ASCII-like rules applied them. In other
words, when doing a "proper" alphabetical sort, is the following list (with
its ASCII-based sorting) "more correct" than the list above?:
{"BLAH", "Blah", "bLAH", "blah"}
Stan C.
_______________________________________________
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