0
0
Data Structures Theoryknowledge~5 mins

Load factor and rehashing in Data Structures Theory - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is the load factor in a hash table?
Load factor is the ratio of the number of stored elements to the total number of slots in the hash table. It shows how full the table is.
Click to reveal answer
beginner
Why is load factor important in hash tables?
Load factor helps decide when to resize the hash table. A high load factor means more collisions, which slows down operations.
Click to reveal answer
beginner
What does rehashing mean?
Rehashing means creating a new larger hash table and moving all existing elements into it using a new hash function or table size.
Click to reveal answer
intermediate
When should rehashing be done?
Rehashing is done when the load factor exceeds a certain threshold, usually around 0.7 or 70%, to keep operations fast.
Click to reveal answer
intermediate
What is the effect of rehashing on hash table performance?
Rehashing reduces collisions by increasing table size, which improves search, insert, and delete speeds but temporarily costs time to move elements.
Click to reveal answer
What does a load factor of 1 mean in a hash table?
AThe table has no collisions
BThe table is empty
CThe table is completely full
DHalf of the table is full
Why do we rehash a hash table?
ATo change the data type of elements
BTo delete all elements
CTo make the table smaller
DTo reduce the number of collisions
Which load factor value usually triggers rehashing?
A0.7
B0.5
C0.1
D1.5
What happens during rehashing?
AElements are moved to a bigger table
BElements are deleted
CElements are sorted
DElements are compressed
What is a downside of rehashing?
AIt deletes data
BIt temporarily slows down operations
CIt reduces table size
DIt causes data loss
Explain what load factor is and why it matters in hash tables.
Think about how full the table is and how that affects speed.
You got /3 concepts.
    Describe the process and purpose of rehashing in hash tables.
    Consider what happens when the table gets too full.
    You got /3 concepts.