What are buckets?
What is the purpose of a hashing table?
Allows fast random access to <key,value> pair logical-records…
…Without any indexing overheads
What determines the bucket location a record is stored in?
A hashing function
How do hashing functions work?
How do collisions occur?
When trying to store a record in a full bucket
What are 3 methods used to minimise collisions?
What are the downsides of method 1:
Increase the number of buckets
What are the downsides of method 2:
Have expandable buckets that can store a flexible amount of records
What are the downsides of method 3:
Use overflow buckets
What is the probability of a collision occurring after adding 4 records to a file with 10 buckets?
Probability a collision has not occurred:
(10/10) x (9/10) x (8/10) x (7/10) = 0.504
Probability a collision has occurred:
1 - 0.504 = 0.496
What are 2 examples of hashing tables?
What is a hash table?
How to search a hash table for an object?
What is the best case scenario when searching and storing data in a hash table?
What is the worst case scenario when searching and storing data in a hash table?