DataStructures / Data structures Interview questions
Preferred way of representing the graph.
Adjacency lists are generally preferred because they efficiently represent sparse graphs. An adjacency matrix is preferred if the graph is dense, that is the number of edges is close to the number of vertices squared.
More Related questions...