
数据结构&算法
wisage
一个不断探索未知世界的人……
展开
-
各种Hash函数和代码
各种Hash函数和代码 常用的字符串Hash函数还有ELFHash,APHash等等,都是十分简单有效的方法。这些函数使用位运算使得每一个字符都对最后的函数值产生影响。另外还有以MD5和SHA1为代表的杂凑函数,这些函数几乎不可能找到碰撞。常用字符串哈希函数有BKDRHash,APHash,DJBHash,JSHash,RSHash,转载 2010-01-25 14:27:00 · 1143 阅读 · 0 评论 -
整数hash
/**//** * Thomas Wang的算法,整数hash */ public static int intHash(int key) { key += ~(key key ^= (key >> 10); key += (key key ^= (key >> 6);转载 2010-01-25 14:08:00 · 1044 阅读 · 0 评论 -
google-sparsehash
An extremely memory-efficient hash_map implementation. 2 bits/entry overhead! The SparseHash library contains several hash-map implementations, including implementations that optimize for space or s转载 2010-01-08 14:37:00 · 2914 阅读 · 0 评论 -
google-sparsehash
<br /><br />An extremely memory-efficient hash_map implementation. 2 bits/entry overhead! The SparseHash library contains several hash-map implementations, including implementations that optimize for space or speed.<br />These hashtable implementations are转载 2010-06-04 11:44:00 · 706 阅读 · 0 评论 -
通用压缩库zlib
<br /><br />zlib 是通用的压缩库,提供了一套 in-memory 压缩和解压函数,并能检测解压出来的数据的完整性(integrity)。zlib 也支持读写 gzip (.gz) 格式的文件。下面介绍两个最有用的函数——compress 和 uncompress。 <br />int compress(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen);<br />compress函数将 source 缓冲区转载 2010-08-16 15:52:00 · 849 阅读 · 0 评论