posted @ 2020-11-10 11:37 玻璃星 阅读(66) 评论(0) 推荐(0) 编辑
摘要:
<?php function insertion_sort(&$arr){ $count = count($arr); for($i=0;$i<$count-1;$i++){ for($j=$i+1;$j<$count;$j++){ if($arr[$j]<$arr[$i]){ $arr[$i] = 阅读全文
摘要:
<?php function bubble_sort(&$arr){ $count = count($arr); for($i=0;$i<$count-1;$i++){ for($j=$i+1;$j<$count;$j++){ if($arr[$j]<$arr[$i]){ $arr[$i] = $a 阅读全文
posted @ 2020-11-09 19:58 玻璃星 阅读(54) 评论(0) 推荐(0) 编辑
摘要:
<?php function selection_sort(&$arr){ $count = count($arr); for($i=0;$i<$count-1;$i++){ $temp = $i; for($j=$i+1;$j<$count;$j++){ if($arr[$j]<$arr[$tem 阅读全文
posted @ 2020-11-09 19:32 玻璃星 阅读(55) 评论(0) 推荐(0) 编辑
摘要:
<?php function get_file_list($path){ $file_list = scandir($path); foreach($file_list as $v){ //防止无限循环,. ..在windwo操作系统中代表当前文件夹和上级文件夹 if($v '.'||$v '..' 阅读全文
posted @ 2020-11-09 11:38 玻璃星 阅读(70) 评论(0) 推荐(0) 编辑
摘要:
1.冒泡排序 2.选择排序 3.插入排序 4.希尔排序 5.归并排序 6.快速排序 阅读全文
posted @ 2020-11-09 10:39 玻璃星 阅读(103) 评论(0) 推荐(0) 编辑
摘要:
作用:移除数组的一部分,并将其替换为其他内容.return array(由提取的元素组成的数组); array_splice (array &$input,$offset,$length = null, $replacement = null)$input array 输入数组$offset int 阅读全文
posted @ 2020-10-29 13:56 玻璃星 阅读(126) 评论(0) 推荐(0) 编辑
摘要:
$a = array('key'=>'value','name'=>'Tom');//Array ( [key] => value [name] => Tom ) $a = array(1,2,3);//Array ( [0] => 1 [1] => 2 [2] => 3 ) 阅读全文
posted @ 2020-10-29 13:41 玻璃星 阅读(98) 评论(0) 推荐(0) 编辑
摘要:
共同点:PHP和C语言的变量名都会被解析成内存地址。 不同点:PHP不同点引用可以引用同一个地址,C语言变量名和指针一一对应。 阅读全文
posted @ 2020-10-27 13:32 玻璃星 阅读(112) 评论(0) 推荐(0) 编辑