Home > Backend Development > PHP Tutorial > php冒泡排序函数

php冒泡排序函数

WBOY
Release: 2016-06-23 13:38:35
Original
1029 people have browsed it

$arr=array(23,5,26,4,9,85,10,2,55,44,21,39,11,16,55,88,421,226,588);function maopao($arr,$value){//$value 1:从小到大的标志  2:从大到小的标志	$n=count($arr);	for($h=0;$h$arr[$i+1]){					$kong=$arr[$i+1];					$arr[$i+1]=$arr[$i];					$arr[$i]=$kong;				}			}else{//从大到小				if($arr[$i]  <br> 
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template