时间:2021-07-01 10:21:17 帮助过:6人阅读
date('Y-m-d H:i:s', strtotime('-1 day')); quick_sort( $left_arr ); $right_arr = $this->quick_sort( $right_arr ); return array_merge( $left_arr, array( $key ), $right_arr ); } /** * 希尔排序 */ public function shell_sort( $datas ) { //分组 for ( $increment = count( $datas ) / 2; $increment > 0; $increment = $increment / 2 ) { //每个组内排序 for ( $i = $increment; $i < count( $datas ); $i++ ) { $temp = $datas[$i]; $j = 0; for ( $j = $i; $j >= $increment; $j = $j - $increment ) { if ( $temp < $datas[$j - $increment] ) { $datas[$j] = $datas[$j - $increment]; } else { break; } } $datas[$j] = $temp; } } return $datas; }}?> 答案2:
0 ) { $returnPath = array_merge( $returnPath, array_fill( 1, $len - $n, '..' ) ); } $returnPath = array_merge( $returnPath, array_slice( $arrA, $n ) ); return implode( '/', $returnPath ); } echo getRelativePath( $a, $b );?>