我刚才想到一点,感觉应该可能是造成我困扰的主要原因 就是我把hash算法和hash表索引算法想成一个东西了 hash算法:time33等, hash表索引算法:h & ht->tTableMask,或者 h % 32 哈希算法的结果是h, h & ht->tTableMask的结果是元素在hash表中的位置
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$w = array('a' =>1, 'b'=>10, 'c'=>14, 'e'=>20, 'f'=>30, 'h'=>6, 'g'=>70); | |
function roll($weight) | |
{ | |
$sum = array_sum($weight); | |
$j = 0; | |
foreach($weight as $k=>$v) | |
{ | |
$j = mt_rand(1,$sum); | |
if($j <= $v) |
####编译前执行下列命令####
#添加组
groupadd www
#添加php-fpm用户
useradd -c php-fpm-user -g www -M php-fpm
# c和c++编译器
yum install -y gcc gcc-c++
邀请码 678082
OlderNewer