Graphs Flashcards

1
Q

Graph Input Formats

What is an array of edges? Anything to note about it

A

An array of edges needs to be traversed over to create a lookup table for node neighbors.

The input type will be a 2D array in the format [x, y].

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

Graph Input Format

What is an adjacency list, anything important to note?

A

Just a 2D array of integer references neighbor nodes, the lookup table is already here for you!

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

Graph Input Type

What is the matrix input type, anything important to note?

A

These are unique to others because there is no set routine, nodes are not necessaily labeled from first to last.

This type is about problem comprehension.

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

Graph Input Types

What is an adjacency matrix, anything important to note?

A

Similar to an adjacency matrix, but the matrix is NxN. This means matrix[i][j] = 1 refers to an edge from i -> j.

One can also elect to traverse the graph at first and turn things into a hashmap, may help when N is large.

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