I want to implement a graph with an array of List<int>, but when I try to initialize the entries with Array.Initialize() with the default values (by calling a parameterless constructor of List<int>), it's like the method was never called and after that all entries are still null!
int n = int.Parse(Console.ReadLine()); // number of nodes
List<int>[] g = new List<int>[n]; //graph
g.Initialize();
It's fine when I iterate over the collection and intitialize, but why is there a problem with the method Initialize()?
List<T>[]is an array though, and that's what he wrote in his code. Could you explain further what exactly you're talking about?