Python, Graph, Algorithms.
also used to represent weighted graphs. Adjacency List: An array of lists is used. The size of the array is equal to the number of vertices. Let the array be an array[]. An entry array[i] represents the list of vertices adjacent to the ith vertex. Let’s consider an example to understand these