...
GATE 2023
October 3, 2023
Compiler-Design
October 3, 2023
GATE 2023
October 3, 2023
Compiler-Design
October 3, 2023

UGC NET CS 2011 June-Paper-2

Question 24
Consider a hash table of size m = 10000 and the hash function h(k) = ⌊m(kA mod 1)’⌋ for      A=(√5 – 1)/2 . The location to the key k=123456 is
A
46
B
47
C
41
D
43
Question 24 Explanation: 
Given data,
— size m=10000
— hash function h(k) = ⌊m(kA mod 1)’⌋
— A=(√5 – 1)/2
— key k=123456 location =?

Step-1: Find out h(123456) = ⌊(10000 * (123456 * (√5 − 1) / 2) mod 1)⌋
= ⌊(10000 * (76300.004115 mod 1)⌋
= ⌊(10000 * (.004115))⌋
= ⌊41.15⌋
= 41

Correct Answer: C
Question 24 Explanation: 
Given data,
— size m=10000
— hash function h(k) = ⌊m(kA mod 1)’⌋
— A=(√5 – 1)/2
— key k=123456 location =?

Step-1: Find out h(123456) = ⌊(10000 * (123456 * (√5 − 1) / 2) mod 1)⌋
= ⌊(10000 * (76300.004115 mod 1)⌋
= ⌊(10000 * (.004115))⌋
= ⌊41.15⌋
= 41

0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
error: Alert: Content selection is disabled!!