摘要:
<?php function bubble_sort(&$arr){ $count = count($arr); for($i=0;$i<$count-1;$i++){ for($j=$i+1;$j<$count;$j++){ if($arr[$j]<$arr[$i]){ $arr[$i] = $a 阅读全文
posted @ 2020-11-09 19:58 玻璃星 阅读(54) 评论(0) 推荐(0) 编辑
|
|
摘要:
<?php function bubble_sort(&$arr){ $count = count($arr); for($i=0;$i<$count-1;$i++){ for($j=$i+1;$j<$count;$j++){ if($arr[$j]<$arr[$i]){ $arr[$i] = $a 阅读全文
posted @ 2020-11-09 19:58 玻璃星 阅读(54) 评论(0) 推荐(0) 编辑
摘要:
<?php function selection_sort(&$arr){ $count = count($arr); for($i=0;$i<$count-1;$i++){ $temp = $i; for($j=$i+1;$j<$count;$j++){ if($arr[$j]<$arr[$tem 阅读全文
posted @ 2020-11-09 19:32 玻璃星 阅读(55) 评论(0) 推荐(0) 编辑 |
|