正在加载图片...
Hash functions are primarily used in hash tables, to quickly locate Hash d(e.g, a dictionary definition) given its search key (the eddWdord Specifically, the hash function is used to map the search key to an index the index gives the place in the hash table where the corresponding record should be stored hash tables, in turn, are used to implement associative arrays and dynamic sets Typically, the domain of a hash function the set of possible keys) is larger than its range the number of different table indices), and so it will map several different keys to the same index, therefore, each slot of a hash table is associated with (implicitly or explicitly) a set of records, rather than a single record for this reason, each slot of a hash table is often called a bucket, and hash values are also called bucket indices Thus, the hash function only hints at the record s location it tells where one should start looking for it. Still, in a half-full table, a good hash function will typically narrow the search down to only one or two entriesHash functions are primarily used in hash tables,to quickly locate a data record (e.g., a dictionary definition) given its search key (the headword). Specifically, the hash function is used to map the search key to an index; the index gives the place in the hash table where the corresponding record should be stored. Hash tables, in turn, are used to implement associative arrays and dynamic sets. Typically, the domain of a hash function (the set of possible keys) is larger than its range (the number of different table indices), and so it will map several different keys to the same index. Therefore, each slot of a hash table is associated with (implicitly or explicitly) a set of records, rather than a single record. For this reason, each slot of a hash table is often called a bucket, and hash values are also called bucket indices. Thus, the hash function only hints at the record's location — it tells where one should start looking for it. Still, in a half-full table, a good hash function will typically narrow the search down to only one or two entries. Hash tables
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有