Please visit our sponsor
UNKNOWN //************************************** // Name: Bubble Sort Algorithm // Description:Simple bubble sort algorithm. // By: Alberto Sartori // // // Inputs:None // // Returns:None // //Assumes:None // //Side Effects:None //This code is copyrighted and has limited warranties. //Please see http://www.Planet-Source-Code.com/xq/ASP/txtCodeId.761/lngWId.8/qx/vb/scripts/ShowCode.htm //for details. //************************************** <?php //BUBBLE SORT ALGORITHM function bubblesort(&$incoming_vector,$outgoing_vector) { $chain=0; $a=0; for($a=$outgoing_vector; $a>0; $a--) { $chain=1; for($v=0; $v&lt;$outgoing_vector ;$v++) { if ($incoming_vector[$v] &gt; $incoming_vector[$v+1]) { $aux=$incoming_vector[$v]; $incoming_vector[$v]=$incoming_vector[$v+1]; $incoming_vector[$v+1]=$aux; $chain=$v; } } $outgoing_vector=$chain; } } ?&gt;