Question: Write an algorithm and a program in ‘C’ language to insert and delete edges in an adjacency list representation of an undirected graph. Make assumptions, if necessary.
Answer:
Assumptions
- The graph is undirected.
- Vertices are numbered from 0 to (V–1).
- No multiple edges between the same pair of vertices.
- Adjacency list is implemented using linked lists.
- Maximum number of vertices is fixed.