graphs Flashcards

1
Q

What is a graph?

A

A graph is a data structure consisting of a set of vertices/nodes connected by edges

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

What is a directed graph?

A

A graph in which the edges can only be traversed in one direction.

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

What is an undirected graph?

A

A graph in which the edges can be traversed in both directions.

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

What is a weighted graph?

A

A graph in which the edges have a value when traversing

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

Give two ways of representing graphs so that they can be understood by computers.

A

Adjacency Matrix, Adjacency List

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

What are the advantages of using an adjacency matrix?

A
  • Convenient to work with
  • Easy to add new nodes to
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are the advantages of using an Adjacency List?

A

Space efficient for large sparse networks

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