<?php
?
?function bin_sch($array,$low,$heigh,$k){
??if($low <= $heigh){
???$mid = intval(($low + $heigh)/2);
???
???if($array[$mid] == $k){
????return true;
???}else if($k <$array[$mid]){
????return bin_sch($array, $low, $mid-1, $k);
???}else {
????return bin_sch($array, $mid+1, $heigh, $k);
???}
??}
?}
?>
详细解决方案
php2分查找法
热度:19 发布时间:2016-04-28 23:46:09.0