Hashing and hash tables
Data Structures · Engineering
Study notes
Store names in a table of size 10 with h = sum of letters mod 10. 'Amit' sums to 41, index 1. 'Ravi' sums to 52, index 2. 'Tina' sums to 42, index 2: collision with Ravi. Chaining appends Tina to the list at slot 2. Lookup hashes then scans only that short list.