Maps Flashcards

1
Q

Maps

When does collision occur?

A

Collision occurs when 2 different keys are hashed to the same value

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Describe how a Hash Map works

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Describe the role “load factor” plays in Hash Maps

A

The load factor determines how full a Hash Map can be at any point in time. For example, a load factor of .75 implies that a Hash Map will expand in size and rehash and redistribute key-value pairs into the exapanded Hash Map. This is done to prevent collision since as the load factor approaches 1, the probability of collision increases

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Hash Maps

What is separate chaining?

A

Separate chaning is the process of using a data structure to store the values of different keys that evaluate to the same hash value

How well did you know this?
1
Not at all
2
3
4
5
Perfectly