ChinaUnix.net
相关文章推荐:

Hash表

如何将hash清空啊?

by globlefly - Perl - 2006-08-18 16:18:15 阅读(16673) 回复(11)

相关讨论

假如有一个item=value的, 对每一个 字符串item有一个相应的字符串value。 怎样在c里面实现这样的hash结构, 用 什么数据结构比较好?

by channel5 - C/C++ - 2006-03-08 12:54:43 阅读(11557) 回复(12)

从网上找了个例子 [code]#include #ifdef DMALLOC #include #else #include #endif #include "hash.h" #ifndef __USE_ISOC99 #define inline #endif struct hashentry { void *key; void *data; struct hashentry *next; }; struct _hashtable { unsigned int (*gethash)(void *); int (*compare)(void *, void *); in...

by wangsheng0415 - C/C++ - 2008-06-24 10:33:18 阅读(1704) 回复(5)

let's say I have two hash tables: new, old How to find out the keys in new, but not in old? How to find out the keys in old, but not in new? tell me the quickest way. Thanks.

by romario94 - Perl - 2007-11-28 19:10:59 阅读(1564) 回复(2)

散列的概念 1、散列  散列方法不同于顺序查找、二分查找、二叉排序树及B-树上的查找。它不以关键字的比较为基本操作,采用直接寻址技术。在理想情况下,无须任何比较就可以找到待查关键字,查找的期望时间为O(1)。  设所有可能出现的关键字集合记为U(简称全集)。实际发生(即实际存储)的关键字集合记为K(|K|比|U|小得多)。 ...

by zieckey - Java文档中心 - 2008-04-12 16:42:53 阅读(704) 回复(0)

NGINX url_hashhash在哪? 用了url_hash可以提高cache的命中率, 但是没法判断cache机器的死活。 谁知道 NGINX url_hashhash在哪?

by gjw_apparitor - 服务器应用 - 2009-06-03 16:28:09 阅读(1415) 回复(0)

我们知道关联数组的计算负责度为 一常量,这其中的关键是 因为是hash的原因。 我一直理解的是,根据key 通过一个hash算法可以得到vlaue的存储位置。 但是今天可以一个应用中的一个dictionary 模块却不是这样子的,请大家解惑啊! 这是头文件 /*-------------------------------------------------------------------------*/ /**    @file dictionary.h    @author N. Devillard  &...

by shake863 - C/C++ - 2009-01-26 23:49:45 阅读(3752) 回复(3)

有几万个基于某字符集的字符串,长度为30。为了便于另外几万个字符串和这个集合的比较,想把这个字符集合建立一个hash,但是建立字符串集合的hash,用什么来做hash函数呢? 比如拿前10个字符的ASCII码等来做,各位有什么好的办法来建立hash以使得这个比较操作更快,谢谢!

by gridbird - C/C++ - 2007-06-27 00:07:48 阅读(4086) 回复(11)

Netfilter的连接跟踪,是通过一个hash来维护的,其首先把一个数据包根据来源/端口/协议转换成一个"tuple",然后根据这个"tuple"来计算hash值: [code]static u_int32_t hash_conntrack(const struct ip_conntrack_tuple *tuple) { #if 0 dump_tuple(tuple); #endif return (jhash_3words(tuple->src.ip, (tuple->dst.ip ^ tuple->dst.protonum), (tuple->src.u.all | (tuple->d...

by 独孤九贱 - 内核/嵌入技术 - 2006-07-23 23:01:59 阅读(1375) 回复(1)

如何把hash的内容放到数组里呢?

by y.kevin - Perl - 2006-04-19 19:31:43 阅读(2209) 回复(5)

我是个刚接触perl的新手 我现在想建立一个hash 有一个txt文件,其内容如下 YAL040C YAL041W YBL016W YBL085W YBR160W YBR200W YDL017W YDL127W YDL155W YDL159W YDR052C YDR054C YDR103W YDR461W YER114C YFL026W YFL039C YGR040W YGR108W YGR109C YHL007C YHR005C YHR084W YJL157C YJR086W YKL178C YLR079W YLR210W YLR229C YLR362W YMR199W YNL053W YNL145W YOR212W YPL031C YPL256C YPR1...

by rainywu - Perl - 2005-03-18 15:59:03 阅读(1491) 回复(3)