Questions Chapter 11 Flashcards
Using big O notation, how long does it take (ideally) to find an item in a hash table
O(1)
A ______ ______ transforms a range of key values into a range of index values
hash function
Using the next available position after an unsuccessful probe is called:
linear probing
What are the first five step sizes in quadratic probing?
x+1^2, x+2^2, x+3^2, x+4^2, x+5^2
Secondary clustering occurs because:
a. many keys hast to the same location
b. the sequence of step lengths is always the same
c. too many items with the same key are inserted
d. the hash function is not perfect
b. the sequence of step lengths is always the same
Separate chaining involves a _________ at each location in the hash table.
linked list at each location in the hash table
A reasonable load factor in separate chaining is:
1
True or False: A possible hash function for strings involves multiplying each character by an ever-increasing power
True
The best technique when the amount of data is not well-known is:
a. linear probing
b. quadratic probing
c. double hashing
d. separate chaining
d. separate chaining
If digit folding is used in a hash function, the number of digits in each group should reflect:
the size of the array
True or False: In linear probing, an unsuccessful search takes longer than a successful search
True
In separate chaining, the time to insert a new item
a. increases linearly with the load factor
b. is proportional to the number of items in the table
c. is proportional to the number of lists
d. is proportional to the percentage of full cells in the array
a. increases linearly with the load factor
True or False: In external hashing, it’s important that the blocks don’t become full.
False
In external hashing, all records with keys that hash to the same value are located in _________________
the same block
The hashing of a key to an already filled array-cell is called:
a collision