二分法和快速排序的PHP实现时间:2022-10-27 18:24:51$pivot = $a[$l]; $i = $l + 1; $j = $r; while(1){ while($a[$i] > $pivot && $i < $j) $i++; while($a[$j] < $pivot) $j--; if($i>=$j) break; $temp = $a[$i]; $a[$i]= $a[$j]; $a[$j]= $temp; } $a[$l] = $a[$j]; $a[$j] = $pivot; return $j; } 原帖:http://info.codepub.com/2008/08/info-21079.html