General Flashcards
1
Q
What is an adjacency list?
A
It’s one way to represent a graph. It’s a mapping of vertices to a list of references to other vertices (called edges). You can store edge weight with (weight, vertex) tuples instead.
2
Q
What is an adjacency matrix?
A
X axis: all vertices, Y axis: all vertices. X, Y: a number representing if X is connected to Y. The number can also represent weight! To find which vertices are connected to X, just look at X’s row.
3
Q
Shortest path through a graph? BFS or DFS?
A
BFS.
4
Q
Force quit
A
cmd-opt-esc
5
Q
Debug requests to a port
A
nc -l 4567
6
Q
A