Lecture 2 - Graph Representations Flashcards
1
Q
How can graphs be represented?
A
Adjacency matrix or adjacency list.
2
Q
What is a adjacency matrix?
A
A structure with a column per vertex andd row per vertex
3
Q
What is an adjacency list?
A
A linked list for each vertex with adjacent vertices.
4
Q
Can a directed graph be represented the same way as an undirected one ?
A
Yes, but only include the verticies adjacent to current, not from.
5
Q
How to implement a graph?
A
Define classes for entries , vertices and graphs.