Skip to content
Related Articles
Get the best out of our app
GFG App
Open App
geeksforgeeks
Browser
Continue

Related Articles

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

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

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

My Personal Notes arrow_drop_up
Last Updated : 19 Jun, 2018
Like Article
Save Article
Similar Reads