Step 1: Initialize empty lists for each vertex: 0: [], 1: [], 2: [], 3: [], 4: []
Step 2: For each edge [u, v], since this is undirected, we add v to u's list and u to v's list.
Edge [0,3] - Add 3 to 0ās list and 0 to 3ās list: 0: [3], 1: [], 2: [], 3: [0]
Edge [0,2] - Add 2 to 0ās list and 0 to 2ās list: 0: [3, 2], 1: [], 2: [0], 3: [0]
Edge [2,1] - Add 1 to 2ās list and 2 to 1ās list: 0: [3, 2], 1: [2], 2: [0, 1], 3: [0]
Step 3: Final adjacency list: 0: [3, 2], 1: [2], 2: [0, 1], 3: [0]. Each list represents the neighbors of that vertex.
Output
0: 3 2
1: 2
2: 0 1
3: 0
Time Complexity: O(V+E), where V = number of vertices, E = number of edges. Auxiliary Space: O(V + E) (average case), O(V²) (worst case if fully connected)