...
GATE 2010
April 18, 2024
Compiler-Design
April 18, 2024
GATE 2010
April 18, 2024
Compiler-Design
April 18, 2024

GATE 2010

Question 53

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?

A
10
B
20
C
30
D
40
Question 53 Explanation: 
Total 6 insertions
― 33 must be inserted at last (only one possibility)

― 46 can be inserted in any of the 5 places remaining. So 5 ways.

― 52 must be inserted only after inserting 42, 23, 34. So only one choice for 52.

〈42,23,34〉 can be sequenced in 3! ways.

Hence, 5×3! = 30 ways

Correct Answer: C
Question 53 Explanation: 
Total 6 insertions
― 33 must be inserted at last (only one possibility)

― 46 can be inserted in any of the 5 places remaining. So 5 ways.

― 52 must be inserted only after inserting 42, 23, 34. So only one choice for 52.

〈42,23,34〉 can be sequenced in 3! ways.

Hence, 5×3! = 30 ways

Leave a Reply

Your email address will not be published. Required fields are marked *