Re: Sort items in a list without OSAXen
Re: Sort items in a list without OSAXen
- Subject: Re: Sort items in a list without OSAXen
- From: Emmanuel <email@hidden>
- Date: Mon, 3 Sep 2001 11:04:05 +0200
At 19:41 +0200 2/09/01, has wrote:
>
p.s. Out of interest - and this is for the more knowledgeable folks than me
>
- what would be the most efficient sort algorithm you could do in AS? And
>
how would it compare for speed against using an OSAX?
There may be no such thing as a most efficient sort algorithm. The
efficiency of each algorithm may depend whether the list to sort is, say,
almost ordered, or quasi-random.
A good and short (15 lines) sort algorithm (at first sight, very similar to
what Arthur just published here) is included in Smile's distribution, so it
has been much tested. On the other hand, it uses recursion, so it will
definitely break on large lists.
I'm sending it below as hexa.
6F6E20736F7274286C290D096966206C656E677468206F66206C20B22031207468656E2072657475
726E206C0D09736574207820746F206974656D2031206F66206C0D09736574206C6C20746F207265
7374206F66206C0D09736574206C3120746F207B7D0D09736574206C3220746F207B7D0D09726570
6561742077697468206920696E206C6C0D090969662078203C2069207468656E0D09090973657420
6C3220746F206C32202620690D0909656C73650D090909736574206C3120746F206C31202620690D
0909656E642069660D09656E64207265706561740D096966206C656E677468206F66206C31203E20
31207468656E20736574206C3120746F20736F7274286C31290D096966206C656E677468206F6620
6C32203E2031207468656E20736574206C3220746F20736F7274286C32290D0972657475726E206C
31202620782026206C320D656E6420736F72740D
Emmanuel