...
Question 3392 – Communication
November 4, 2023
Question 17084 – NTA UGC NET JUNE-2023 Paper-2
November 4, 2023
Question 3392 – Communication
November 4, 2023
Question 17084 – NTA UGC NET JUNE-2023 Paper-2
November 4, 2023

Question 17076 – NTA UGC NET JUNE-2023 Paper-2

Consider a hash table of size seven with starting index zero and a hash function(6x+3) mod 4.Assuming the hash table is initially empty.Which of the following is the content of the table when the sequence 1,3,8,10,5 is inserted into the table using closed hashing? Here “_” denotes an empty location in the table.

Correct Answer: D

Question 1 Explanation: 
To insert the sequence 1, 3, 8, 10, and 5 into the hash table using closed hashing, we’ll use the given hash function (6x + 3) mod 4. Here’s how the table would look after each insertion:

Insert 1:
Hash value = (6 * 1 + 3) mod 4 = (6 + 3) mod 4 = 9 mod 4 = 1
Table: _, 1, _, _, _, _, _

Insert 3:
Hash value = (6 * 3 + 3) mod 4 = (18 + 3) mod 4 = 21 mod 4 = 1 (collision)
Since the slot at index 1 is already occupied, we’ll perform linear probing (moving to the next slot until we find an empty one).
Table: _, 1, 3, _, _, _, _

Insert 8:
Hash value = (6 * 8 + 3) mod 4 = (48 + 3) mod 4 = 51 mod 4 = 3
Table: _, 1, 3, 8, _, _, _

Insert 10:
Hash value = (6 * 10 + 3) mod 4 = (60 + 3) mod 4 = 63 mod 4 = 3 (collision)
Linear probing again.
Table: _, 1, 3, 8, 10, _, _

Insert 5:
Hash value = (6 * 5 + 3) mod 4 = (30 + 3) mod 4 = 33 mod 4 = 1 (collision)
Linear probing.
Table: _, 1, 3, 8, 10, 5, _

So, the content of the table after inserting the sequence 1, 3, 8, 10, and 5 is:

_, 1, 3, 8, 10, 5, _

A
1,3,8,10,5,_,_

B
3,8,1,_,10,_5
C
_,3,8,1,_,10,5
D
_1,3,8,10,5,_
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!!