基于字符串的hash算法
来源:互联网 发布:php微信公众号开发 编辑:程序博客网 时间:2024/05/22 10:44
truct hash_map_func
...{
enum
...{ // parameters for hash table
bucket_size = 2, // 0 < bucket_size
min_buckets = 8
}; // min_buckets = 2 ^^ N, 0 < N
size_t operator()(const string& str)const
...{
const char* p =str.c_str();
unsigned long hash = 5381;
int c;
while (c = *p++)
hash = ((hash << 5) + hash) + c; /**//* hash * 33 + c */
return hash;
}
bool operator()(const string& _Keyval1, const string& _Keyval2) const
...{ // test if _Keyval1 ordered before _Keyval2
return (gt(_Keyval1, _Keyval2));
}
greater<string> gt;
};
...{
enum
...{ // parameters for hash table
bucket_size = 2, // 0 < bucket_size
min_buckets = 8
}; // min_buckets = 2 ^^ N, 0 < N
size_t operator()(const string& str)const
...{
const char* p =str.c_str();
unsigned long hash = 5381;
int c;
while (c = *p++)
hash = ((hash << 5) + hash) + c; /**//* hash * 33 + c */
return hash;
}
bool operator()(const string& _Keyval1, const string& _Keyval2) const
...{ // test if _Keyval1 ordered before _Keyval2
return (gt(_Keyval1, _Keyval2));
}
greater<string> gt;
};
- 基于字符串的hash算法
- 基于字符串的分离链接hash算法
- 基于字符串的分离链接hash算法
- 字符串的hash算法
- 基于整数的hash算法
- 查找字符串的hash算法
- 查找字符串的hash算法
- 字符串的经典hash算法
- 字符串的经典hash算法
- 字符串的经典hash算法
- 字符串的经典hash算法
- 字符串的经典hash算法
- 字符串的经典hash算法
- 基于hash表的文件字符串替换
- 基于英文单词的快速HASH索引算法。
- 基于英文单词的快速HASH索引算法
- 基于英文单词的快速HASH索引算法
- 基于英文单词的快速HASH索引算法
- 微软的常用资源列表
- MD5 报文摘要算法
- frame使用
- ASP.NET中弹出窗口技术
- [Apache-Fulcrum-Intake]表示层和业务层的数据传递组件
- 基于字符串的hash算法
- Dot net 正则表达式的应用
- SQL Server 存储过程的经典分页
- ASP调用oracle存储过程
- 基于整数的hash算法
- 告诉你一个真实加拿大
- 揭开戴尔代工厂黑幕 每天13元每月2千人离开
- [广州.天河.棠下]停电不爽,但在好又多看中了一款LG洗衣机,售货员很有经验
- 在线正则表达式测试工具