Open In App
Related Articles

UGC-NET | UGC NET CS 2015 Jun – III | Question 34

Improve
Improve
Improve
Like Article
Like
Save Article
Save
Report issue
Report

Consider a hash table of size m = 100 and the hash function h(k) = floor(m(kA mod 1)) for Compute the location to which the key k = 123456 is placed in hash table.

(A)

77

(B)

82

(C)

88

(D)

89



Answer: (C)

Explanation:

h(k) = floor(m(kA mod 1)) M = 100; k = 123456 h(k) = floor(100(123456 * 0.618033 mod 1)) h(k) = floor(100(76189.882048 mod 1)) h(k) = floor(100 * 0.882048) h(k) = floor(88.2048) h(k) = 88. So, option (C) is correct.



Quiz of this Question
Please comment below if you find anything wrong in the above post

Last Updated : 19 Jun, 2018
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads