Seeing as someone's already found a bubble sort, I'll just post this
quicksort I found on a php digest list. ;)
<!--- apparently by [EMAIL PROTECTED] --->
<CFSCRIPT>
variables.i = attributes.left;
variables.j = attributes.right;
variables.x = Request.TheArray[(attributes.left+attributes.right) / 2];
do
{
while (Request.TheArray[variables.i] lt variables.x)
variables.i=variables.i+1;
while (variables.x lt Request.TheArray[variables.j])
variables.j=variables.j-1;
if (variables.i lte variables.j)
{
variables.temp=Request.TheArray[variables.i];
Request.TheArray[variables.i]=Request.TheArray[variables.j];
Request.TheArray[variables.j]=variables.temp;
variables.i=variables.i+1;
variables.j=variables.j-1;
}
}
while (variables.i LTE variables.j);
</CFSCRIPT>
<CFIF attributes.left LT variables.j>
<CF_Quicksort left=#attributes.left# right=#variables.j#>
</CFIF>
<CFIF variables.i LT attributes.right>
<CF_Quicksort left=#variables.i# right=#attributes.right#>
</CFIF>
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.