php木桶排序
2019獨角獸企業重金招聘Python工程師標準>>>
<?php//木桶排序$count?=?array(6,10,4,12,4,90,33);function?mutong($max,$array){//填充木桶$arr?=?array_fill(0,?$max,?0);//開始標示木桶for($i?=?0;?$i<=count($array)-1?;?$i++){//var_dump($array[$i]);$arr[$array[$i]]++;}$mutomg?=?array();//開始從木桶中拿出數據for($i?=?0;?$i<=?$max?;?$i++){for($j?=?1;?$j?<=?$arr[$i];?$j++){?//這一行主要用來控制輸出多個數字$mutong[]?=?$i;}}return?$mutong;}var_dump(mutong(90,$count));轉載于:https://my.oschina.net/u/1414906/blog/309325
總結
- 上一篇: CentOS安装PPTP ×××
- 下一篇: 动态规划算法php,php算法学习之动态