Week 10 - Graph structure/ Algorithms Flashcards

1
Q

What is a graph in data structures?

A

A graph is a data structure used to represent a collection of objects (called vertices or nodes) and the connections between them (called edges).

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

What is the difference between Undirected and Directed graphs?

A

Undirected: Edges are bidirectional (no direction).

Directed: Edges have a direction (from one vertex to another).

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

What is the difference between Unweighted and Weighted graphs?

A

Unweighted: Does not assign any numerical value to the edges.

Weighted: Assigns a numerical value (weight) to the edges.

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

What are the four types of graph?

A
  • Undirected & Unweighted
  • Directed & Unweighted
  • Undirected & Weighted
  • Directed & Weighted
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is an example of an Undirected & Unweighted graph?

A

Example: Facebook relationship

Vertices: Registered people

Edges: Friendships (mutual)

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

What is an example of a Directed & Unweighted graph?

A

Example: Twitter/X relationship

Vertices: Registered people

Edges: Who is following whom

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

What is an example of an Undirected & Weighted graph?

A

Example: Train map

Vertices: Train stops/stations

Edges: Rail lines connecting train stops, with their length (weight)

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

What is an example of a Directed & Weighted graph?

A

Example: Financial networks

Vertices: Bank accounts

Edges: Money transfers with the amount (weight)

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