Searching Flashcards

1
Q

What is a hash table?

A

Data structure that lets us find stored values more efficiently than sequential search O(n) or binary search O(log n) if using indices instead of slicing, which is O(n)

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

What’s a slot in a hash table?

How is it named and what does it hold?

A

each position of a hash table, named by an integer value (starting at 0) - indices of the list
holds an item

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

What maps an item with the slot it’ll be in in the hash table?

A

Hash function

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

What is the load factor?

A

number of items in table / number of slots in the table

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

Name 2 methods for a hash function

A

Remainder method

Folding method

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

Name 2 main collision resolution tactics

A

Open Addressing

Chaining

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