Is my algorithm faster then php sort() ?
algo:
$a = array(0,3,4,2,7,6,6,8,6,1);
$z = count($a)-1;
for($i = 0;$i < $z; $i++){
if($a[$i] > $a[$i+1]){
$temp = $a[$i];
$a[$i] = $a[$i+1];
$a[$i+1] = $temp;
$i = -1;
}
}
echo "<pre>";
print_r($a);
echo "</pre>";
compare with php sort() ... let me know your results as i have bad internet...