Voting

: max(six, seven)?
(Example: nine)

The Note You're Voting On

loushou - life dot 42 at gmail dot com
16 years ago
i miss posted the actual function...
here is the real one lol

<?php

function q_sort(&$Info, $Index, $Left, $Right)
{
echo
"memory usage <b>".memory_get_usage()."</b><br/>\n";
$L_hold = $Left;
$R_hold = $Right;
$Pivot = $Left;
$PivotValue = $Info[$Left];
while (
$Left < $Right)
{
while ((
$Info[$Right][$Index] >= $PivotValue[$Index]) && ($Left < $Right))
$Right--;
if (
$Left != $Right)
{
$Info[$Left] = $Info[$Right];
$Left++;
}
while ((
$Info[$Left][$Index] <= $PivotValue[$Index]) && ($Left < $Right))
$Left++;
if (
$Left != $Right)
{
$Info[$Right] = $Info[$Left];
$Right--;
}
}
$Info[$Left] = $PivotValue;
$Pivot = $Left;
$Left = $L_hold;
$Right = $R_hold;
if (
$Left < $Pivot)
q_sort($Info, $Index, $Left, $Pivot-1);
if (
$Right > $Pivot)
q_sort($Info, $Index, $Pivot+1, $Right);
}

?>

<< Back to user notes page

To Top