note 84731 deleted from function.array-splice by danbrown

From: Date: Mon, 28 Jul 2008 00:25:17 +0000
Subject: note 84731 deleted from function.array-splice by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-142835@lists.php.net to get a copy of this message
Note Submitter: loushou - life dot 42 at gmail dot com ---- 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); } ?>

« previous php.notes (#142835) next »