Week 3 Graphs & hash tables Flashcards

(8 cards)

1
Q

What does the hash function do?

A

1.Converts input (key) into a fixed-size integer, the hash code.
2.Ensures uniform distribution to minimise collisions.

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

How does the hash function resolve collisions?

A
  1. Separate Chaining: Stores collided keys in a linked list or other structure.
  2. Open Addressing: Finds the next available slot using methods like linear
    probing or quadratic probing.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Hash table load factor?

A

The ratio of stored elements to the number of slots.

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

Hash table resizing?

A

Rehashing to a larger table size when the load factor exceeds a
threshold.

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

Hash table implementation performance optimisation consideration?

A

Aim for O(1) average-case time complexity for insertion, deletion, and
search.

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

What are graph vertices?

A

Nodes representing entities.

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

What are graph edges?

A

Connections between vertices, representing relationships.

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