Graphs Flashcards

(6 cards)

1
Q

What are graphs made up of ?

A

Nodes,
Edges.

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

What are the three types of graphs ?

A

Undirected Graphs - Edges have no direction,
Directed Graphs - Edges have a specific direction,
Weighted Graphs - Edges have associated weights or costs.

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

What is the difference between a path and a simple path ?

A

A path is a sequence of nodes connected by edges,
A simple path is a path that does not revist nodes.

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

What is a connected graphs ?

A

Ever node can reach every other node.

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

What is an Adjacency matrix ?

A

2D array representation,
Matrix[i][j] = 1 if there is an edge, 0 if otherwise,
Efficient for dense graphs.

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

What is an Adjancency List ?

A

Array of linked lists where each list contains a node’s neighbours.
Efficient for sparse graphs.

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