Академический Документы
Профессиональный Документы
Культура Документы
its search key (the headword). Specifically, the hash function is used to map the search key to the index of a slot in the table where the corresponding record is supposedly stored. Division Method: Choose the number n larger then the number n of the keys in K. The number n is ussualy choosen to be a prime number or a number with a small number of divisors. This frequently minimize the number of collisions. The hash function H is defined by H(k)=k(mod m) or H(k) = (mod m)+1
Midsquare method: The key k is squared then the hash function H is defined by H(k)=I Where I is obtained by deleting digits from both ends of K2 we emphasize that the same positions of K2must be used for all of the keys.
Folding Method: The key K is partitioned into a number of parts k1, k2,.kr where each part except possibily the last has the same number of digits as the required address. Then the parts are edit together ignoring the last carry that is H(k) = k1+k2+kr Where the leading digit carries are ignored some time for extra miling the even numbered parts k2,k4, are each reversed before the addition. H(4502) = 54+20 = 74