4.2.6-7 - FoDS (Hash Tables and Dictionaries) Flashcards

1
Q

What is a hash table

A

A Data structure that creates a mapping between keys and values as pairs

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

What is an abstract data type

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

What are hash tables made of

A
  • An array we call a hash table
  • This is linked to a hash function
  • Keys are inputted into the function which returns a hash value
  • The hash value determines where in the hash table the value is stored
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are some examples of hash functions

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

What is meant by a collision

A
  • When two key values compute to the same hash
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the 3 ways to avoid collisions

A
  • Closed Hashing
  • Open Hashing
  • Rehashing
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How does a Closed-Hashing work

A

When there is a collision:
- data is stored in the next available empty location in the hash table
- The original location points to the next location

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