php冒泡排序
<?php//冒泡算法$array=array(5,2,576,823,21,56,79,99);echo'<pre/>';print_r($array);$count=count($array);for($i=0;$i<$count;$i++){for($j=$i;$j<$count;$j++){if($array[$j]>$array[$i]){$temp=$array[$i];$array[$i]=$array[$j];$array[$j]=$temp;}}}echo'<hr/>';print_r($array);
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。