Open Addressing / Linear Probing (Module 7) Flashcards

1
Q

Which collision resolution technique finds another open slot in the hash table to store the key when collision occurs?

A

open addressing

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

What are the 3 ways to find an avaliable slot through probing?

A

1) linear probing
2) quadratic probing
3) double hashing

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

Which type of probing sequentially searches the table from the index of the collision until an open slot is found?

A

linear probing

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

What is linear probing’s primary hash function?

A

hash(k)

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

What is the linear probing formula?

A

(hash(k) + i) mod m

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

What happens when multiple keys are hashed to the same buckets leading to a group of occupied buckets growing with each collision?

A

clustering

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

Why is clustering problematic?

A

collisions lead to longer probe sequences and access times (degraded performance)

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

Resizing and rehashing is ___________!

A

expensive

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

What is the advantage of linear probing?

A

simple implementation

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

What is the disadvantage of linear probing?

A

creates clusters that slow down insertion/search operations

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