Consider a hash table with 9 slots. The hash function is ℎ(k) = k mod 9. The collisions are resolved by chaining. The following 9 keys are inserted in the order: 5, 28, 19, 15, 20, 33, 12, 17, 10. The maximum, minimum, and average chain lengths in the hash table, respectively, are

This question was previously asked in
GATE CS 2014 Official Paper: Shift 1
View all GATE CS Papers >
  1. 3, 0, and 1
  2. 3, 3 and 3
  3. 4, 0, and 1
  4. 3, 0, and 2

Answer (Detailed Solution Below)

Option 1 : 3, 0, and 1
Free
GATE CS Full Mock Test
65 Qs. 100 Marks 180 Mins

Detailed Solution

Download Solution PDF

Concept:

Keys: 5, 28, 19, 15, 20, 33, 12, 17,

10.

ℎ(k) = k mod 9

Chaining

Maximum chain length = 3 (28 -> 19 -> 10)

Minimum chain length = 0 (0, 4, 7 slot doesn’t have any element)

Hence option 1 is the correct answer.

Latest GATE CS Updates

Last updated on Jan 8, 2025

-> GATE CS 2025 Admit Card has been released on 7th January 2025.

-> The exam will be conducted on 1st February 2025 in 2 shifts.

-> Candidates applying for the GATE CE must satisfy the GATE Eligibility Criteria.

-> The candidates should have BTech (Computer Science). Candidates preparing for the exam can refer to the GATE CS Important Questions to improve their preparation.

-> Candidates must check their performance with the help of the GATE CS mock tests and GATE CS previous year papers for the GATE 2025 Exam.

More Searching Questions

Hot Links: teen patti master 51 bonus teen patti star teen patti real cash withdrawal