Home >php教程 >PHP源码 >全组合算法

全组合算法

PHP中文网
PHP中文网Original
2016-05-26 08:18:291103browse


=sizeof($input_arr)-1){
		return $input_arr[$index];
	}else{
		$low_b=combination($input_arr,$index+1);
		$b=array();
		foreach($input_arr[$index] as $ch)
			foreach($low_b as $low_arr)
				$b[]=array_merge(array($ch),is_array($low_arr)? $low_arr: array($low_arr));
		return $b;
	}
}

                   

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:500错误 详情打印Next article: ThinkPHP简单网站后台