For matrix:
For each vertex, there is one row and one column. Position i, j contains 1 if the edge is from vertex i to vertex j.
The size of the entire matrix is | V | ^ 2
Why complexity | V | ^ 2?
Since each position in the matrix is visited once.
For a related adjacency list:
A collection of linked lists with one list for each vertex, so that the list for vertex v is a list of all vertices adjacent to vertex v.
| E | + | V |?
, | V | | E | .