Data Structures(Linked list representation of graphs)
Linked list representation of graphs:
A graph can be represented using a linked list.
It requires less amount of memory.
For each vertex, a list of adjacent vertices is maintained using a linked list.
Adjacency list of a graph is represented by an array of pointers and each pointer points to the respected linked list of vertex.
Example Consider the diagram
Adjacency list of a graph as shown below
Comments
Post a Comment