V = number of vertices in the graph
Matrix Favors:
1. You can access the edge (find out if there is an edge between two vertices), given its end vertices in constant time, while using the adjacency list takes time O (degree (vertex)).
2. The matrix is good if your schedule is tight. Otherwise, it spends space because it uses O (V * V) space.
Points for adjacency list:
1. You need O (V) time to iterate to get neighboring vertices, while an adjacency list requires O (degree (vertex)).
2. The adjacency list does not take up much space.
source share