Alternate Random Sort?

Scott Rossi scott at tactilemedia.com
Fri Jul 14 16:31:50 EDT 2006


Recently, Brian Yennie wrote:

> How about something like this. The idea being to loop through the lines
> and insert them into random keys of an array, then combine the array at
> the end.
> This avoids any comparisons involved in sorting - it just sort of
> scatters them in the array and then pulls them back out. Also the
> random number is picked to be large so you only get a very small number
> of collisions forcing you to pick your random number more than once.

This is awesome Brian, thank you.  I *think* I get what you're doing with
the random number, but I'll need to study it more.  In any event, you
provided a nice solution for another solution I'll be posting soon. :-)

Regards,

Scott Rossi
Creative Director
Tactile Media, Multimedia & Design
-----
E: scott at tactilemedia.com
W: http://www.tactilemedia.com





More information about the use-livecode mailing list