php实现冒泡原理
摘要:
<?phpfunction bsort($array){$count = count($array);if($count == 0){echo 0;}else if($count == 1){echo $array;}else if($count > 1){for($i=0;$i<$count;$i++){for($j=$count-1;$j>$i;$j--){if($array[j]<$array[j-1]){$temp = $array[j];$array[j] = $array[j-1];$array[j-1] = $temp;} }}return $arr 阅读全文
posted @ 2012-03-26 22:32 小林--2012 阅读(154) 评论(0) 推荐(0)
浙公网安备 33010602011771号