Yr2 Hash Tables Flashcards

(8 cards)

1
Q

What is a hash table?

A

Where data is stored is determined by hashing said data to produce the number corresponding to a memory location based

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

What is the theoretical speed of a hash table search?

A

O(1)

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

What is a big issue with hash tables?

A

Collisions - collisions are where two pieces of data produce the same memory location when hashed

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

What are the two solutions to hash table collisions?

A
  1. Overflow (best solution)
  2. Storing in the next memory location
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How can overflow be used to solve a hash table collision?

A

Using a linked list store both pieces of data in the same memory location and refer to them using pointers when needed.

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

What issues are there with using overflow to solve a hash table collision?

A

The memory location may be unable to store both pieces of data if they are too large

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

What problems are there with storing data int he next memory location in order to solve hash table collisions?

A

It increases the chance of collisions in the future

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

What is a dictionary?

A

A data structure that maps items to other specified values

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