-
When the DI value may be 1, 2, 3 ,..m-1, called linear probe rehashing.
The details are as follows: where m is the table length of the hash table. di is the sequence of deltas when a conflict occurs. If the DI value may be 1, 2, 3 ,..m-1, called linear probe rehashing.
If di takes 1, then after each conflict, move backward by 1 position. If the value of di is 1, -1, 4, -4, 9, -9, 16, ,.. 16k*k, -k*k(k<=m 2), called secondary detection and then hashing, if the value of di may be a pseudo-random sequence.
It is called pseudo-random probe rehashing.
A hash table (also known as a hash table) is a data structure that is directly accessed based on the key value. That is, it accesses records by mapping key values to a location in the table to speed up lookups. This mapping function is called a hash function, and the array that holds the records is called a hash table.
Given table m, there is a function f(key), for any given keyword value key, if the address of the record containing the keyword can be obtained after substituting the function into the key, then table m is called a hash table, and the function f(key) is a hash function.
-
When the DI value may be 1, 2, 3 ,..m-1, called linear probe rehashing.
The details are as follows: where m is the table length of the hash table. di is the sequence of deltas when a conflict occurs. If the DI value may be 1, 2, 3 ,..m-1, called linear probe rehashing.
If di takes 1, then after each conflict, move backward by 1 position. If the value of di is 1, -1, 4, -4, 9, -9, 16, ,.. 16k*k, -k*k(k<=m 2), called secondary detection and then hashing, if the value of di may be a pseudo-random sequence.
It is called pseudo-random probe rehashing.
Ways to deal with conflicts:
Open addressing: hi=(h(key) +di) mod m, i=1,2,..., k(k<=m-1), where h(key) is the hash function, m is the hash table length, and di is the incremental sequence, which can be taken in the following three ways:
1、di=1,2,3,…m-1, called linear probe rehashing.
2、di=1^2, -1^2, 2^2,-2^2, 3^2, …k) 2, (k<=m 2) is called secondary detection rehashing.
3. DI = pseudo-random number sequence, called pseudo-random detection and then hashing.
Rehashing: hi=rhi(key), i=1,2,...,k.rhi are different hash functions, that is, when a synonym produces an address conflict, another hash function address is computed until the conflict no longer occurs, which is not easy to produce "clustering", but increases the computation time.
Conflict resolution with secondary detection and rehashing:
1. (key+1 2)%11=(49+1)%11=6, and the conflict still occurs.
2. (key-1 2)%11=(49-1)%11=4, and there is still a conflict.
3. (key+2 2)%11=(49+4)%11=9, no more conflicts.
The above content refers to Encyclopedia-Hash Table.
-
Linear detection rehashing is a calculation method for conflict resolution in hash tables, hash tables are also known as hash tables, and the basic idea of hash table storage is: take the keyword k of each record in the data table as the independent variable, and calculate the function value through a function h(k).
Interpret this value as the cell address (i.e., subscript) of a contiguous piece of storage (i.e., array space) and store the record in this cell. The function h is referred to here as a hash function or a hash function. Tables built in this way are called hash tables or hash tables.
hi=(h(key)+di) %m,i=1,2,……k(k<=m-1), h(key) hash function, m-hash table length, di increment sequence.
When the DI value may be 1, 2, 3 ,..m-1, called linear probe rehashing. There is a formula for the open address method: hi=(h(key)+di) mod m i=1,2,..k(k<=m-1)。
where m is the length of the hash table. di is the sequence of deltas when a conflict occurs.
If di takes 1, then after each conflict, move backward by 1 position. If the value of di is , it may bek*k, -k*k(k<=m 2), called secondary detection and then hashing, if the value of di may be a pseudo-random sequence.
It is called pseudo-random probe rehashing.
Ways to deal with conflicts:
1. Open addressing method: hi=(h(key) +di) mod m, i=1,2,..., k(k<=m-1), where h(key) is the hash function, m is the hash table length, and di is the incremental sequence, which can be taken in the following three ways:
1)di=1,2,3,…m-1, called linear probe rehashing.
2)di=1^2, -1^2, 2^2,-2^2, 3^2, …k) 2, (k<=m 2) is called secondary detection rehashing.
3. DI = pseudo-random number sequence, called pseudo-random detection and then hashing.
2. Rehashing method: hi=RHI(key), i=1,2,...,k.rhi are different hash functions, that is, when a synonym produces an address conflict, another hash function address is computed until the conflict no longer occurs, which is not easy to produce "clustering", but increases the computation time.
Warring States period. Ryokyu is from the Warring States period. >>>More
The income statement is an accounting statement that reflects the production and operation results of an enterprise in a certain accounting period (such as monthly, quarterly, semi-annual or annual). The operating results of an enterprise in a certain accounting period may be manifested as both profits and losses, therefore, the income statement is also known as the profit and loss statement. It provides a comprehensive picture of the various revenues realized, the various expenses, costs or expenses incurred by the enterprise in a specific period, as well as the profits realized or losses incurred by the enterprise. >>>More
Recommend Yanjin black-bone chicken, eat meat is not firewood, the soup is particularly fresh, raised for more than 300 days, the stewed soup is nourishing and delicious, two high and one low. >>>More
Pear trees bloom in the spring, and pesticides are sprayed regularly to promote better flowering. For example, during the flowering period, the whole tree can be sprayed with 1000 times the main effect of cyanagen, which can effectively prevent the occurrence of pests and diseases. Generally, the best time to spray pesticides is in the morning, and preventive measures against spring cold and frost should be prepared. >>>More
Marketing is the process of planning, and implementing the design, pricing, distribution, and distribution of ideas, products, and services, resulting in an exchange that meets individual and organizational goals.