The Adjacency List is a 2D array used to represent the connections between vertices in a graph. It consists of an array of vertices, where each vertex maintains an array (or list) of its adjacent vertices.
Toggle between the directed and undirected graph to see the difference.
Edit the undirected graph so that it is equal to the adjacency list below:
[
[1,2,3],
[0,3],
[0,4],
[0,1,4],
[2,3]
]
Edit the directed graph so that it is equal to the adjacency list below:
[
[3],
[0],
[0],
[2],
[0,1]
]
Node Index:
Node ID:
0[
1
,
2
] 1[
0
] 2[
0
] 3[]
4[]
5[]