Chapter 5 (Hashing) Flashcards
Table size should be a ____ ____
Prime number
In perfect hashing, what is the worst case access time?
O(1)
What is a drawback of the chaining method?
Allocating new nodes
What is the formula for the expected number of probes in a linear probing strategy?
1/(1-lambda)
What is the worst case running time for a find in hopscotch hashing?
O(1)
T/F Java hash tables require the “equals” and “hashCode” methods to be defined on the hashed objects
T
How many hash tables does cuckoo hashing use?
2
How does separate chaining handle collisions?
Each index contains a list. Each item that collides is contained in this list
What is primary clustering?
A large list of values clustered around the same cell
What is the primary drawback of linear probing?
Primary clustering
What is it called when two keys map to the same location?
Collision
What is lambda?
The ratio of the number of elements to the table size
What is the job of the hash function?
Mapping
What is the average running time for inserts, deletes, and finds for hashing?
O(1)
T/F Hashing supports operations like findMin and findMax
F