Complete the code to declare an adjacency list for a graph with 5 vertices.
List<int>[] graph = new List<int>[[1]];The graph has 5 vertices, so the adjacency list array size should be 5.
Complete the code to initialize each list in the adjacency list array.
for (int i = 0; i < graph.Length; i++) { graph[i] = new [1]<int>(); }
Each element in the adjacency list array should be a new List<int> to hold neighbors.
Fix the error in adding an edge from vertex 1 to vertex 3.
graph[1].[1](3);
To add an element to a List in C#, use the Add method.
Fill both blanks to add an undirected edge between vertices 2 and 4.
graph[[1]].Add([2]); graph[[2]].Add([1]);
For an undirected edge between 2 and 4, add 4 to graph[2] and 2 to graph[4].
Fill all three blanks to print neighbors of vertex 0 using a foreach loop.
foreach (int [1] in graph[[2]]) { Console.[3]([1] + " "); }
Use 'neighbor' as loop variable, 0 as vertex index, and Console.Write to print on same line.
