Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
1.0k views
in Computer by (69.3k points)

Rewrite your solution to part (b) using rehashing as the method of collision resolution. Use [(key+3) mod table-size] as rehash function.

1 Answer

+1 vote
by (69.8k points)
selected by
 
Best answer

Rehash function [(key+3) mod table size] 

H(25) = 28 mod 11 

H(42) = 45 mod 11 

H(96) = 99 mod 11 

H(101) = 104 mod 11 

H(102) = 105 mod 11 

H(162) = 165 mod 11 

H(197) = 200 mod 11 

H(201) = 204 mod 11

The newly created hash function is as follows:- 

Hash[0] = [96] 

Hash[1] = [42] 

Hash[2] = [162] 

Hash[3] = [197] 

Hash[4] = [NULL] 

Hash[5] = [101] 

Hash[6] = [25] 

Hash[7] = [102] 

Hash[8] = [201] 

Hash[9] = [NULL] 

Hash[10] = [NULL] 

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...