Re: sorting questing
Maybe you can attach a "length indicator," such as "000x", where x is the
value of the length of the item.
sort that list.
remove the indicator.
For example:
For the following list
{ "one, two, three, four, five, six, seventeen, twenty, etc" }
the indicator list would be
en","0006twenty","0003etc"}
You would sort that... which should be a natural for the built-in sorter...
Then go back and remove the indicator items...
You know...
for t= 1 to length(list)
list[t] = list[t][5..length(list[t])]
end for
The key is, make the indicators the same length!
The benefit is, you only have to sort one list.
...or something like that.
-ck
----- Original Message -----
From: John McAdam <john.mcadam at MAIL.TELEPAC.PT>
To: <EUPHORIA at LISTSERV.MUOHIO.EDU>
Sent: Friday, April 28, 2000 2:20 PM
Subject: sorting questing
> I have a list of words that I want to sort by word length.
> The longest words first, down to the shortest word.
> Do I make another sequence that holds the word length,
> then sort that? If so, then how to relate the two lists?
> Its probably a simple algorithm, but its been a hard week
> and I can't get it to work out.
> JOHN
>
|
Not Categorized, Please Help
|
|