...
Question 9065 – Data-Structures
April 18, 2024
Question 9067 – Data-Structures
April 18, 2024
Question 9065 – Data-Structures
April 18, 2024
Question 9067 – Data-Structures
April 18, 2024

Question 9066 – Data-Structures

A hash table of length 10 uses open addressing with hash function h(k)=k mod 10, and linear probing. After inserting 6 values into an empty hash table, the table is as shown below.

How many different insertion sequences of the key values using the same hash function and linear probing will result in the hash table shown above?

Correct Answer: C

Question 57 Explanation: 
Hash Table consists of 10 slots, uses Open Addressing with hash function and linear probing.
After inserting 6 values, the table looks like

The possible order in which the keys are inserted are:

34, 42, 23, 46 are at their respective slots 4, 2, 3, 6.
52, 33 are at different positions.

― 52 has come after 42, 23, 34 because, it has the collision with 42, because of linear probing, it should have occupy the next empty slot. So 52 is after 42, 23, 34.

― 33 is after 46, because it has the clash with 23. So it got placed in next empty slot 7, which means 2, 3, 4, 5, 6 are filled.
42, 23, 34 may occur in any order but before 52 & 46 may come anywhere but before 33.


So option (C)
A
46, 42, 34, 52, 23, 33
B
34, 42, 23, 52, 33, 46
C
46, 34, 42, 23, 52, 33
D
42, 46, 33, 23, 34, 52
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!!