数据结构和算法(转载) 原文地址: https://blog.csdn.net/s1070/article/details/51174725 1.使对象可以像数组一样进行foreach循环,要求属性必须是私有。(Iterator模式的PHP5实现,写一类实现Iterator接口)(腾讯) <?php Read More
posted @ 2018-06-05 15:13 _Eternity味道 Views(237) Comments(0) Diggs(0) Edit
算法 Read More
posted @ 2018-06-05 14:15 _Eternity味道 Views(93) Comments(0) Diggs(0) Edit
/* 递归调用实现二分法查找 //$search 函数 $array为数组,$K为要找的值,$low为查找范围的最小键值,$high为查找范围的最大键值 //intval返回整数值*/ function search($array,$k,$low=0,$high=0){ //判断数组元素的数量 if(count($array)!=0 and $high==0){ ... Read More
posted @ 2018-06-05 11:23 _Eternity味道 Views(676) Comments(0) Diggs(0) Edit