To create an adjacency list C++’s map container can be used.

Category: QuestionsTo create an adjacency list C++’s map container can be used.
Editor">Editor Staff asked 1 month ago

To create an adjacency list C++’s map container can be used.
 
(a) True
 
(b) False
 
The question is from Adjacency List topic in section Graph of Data Structures & Algorithms I
 
I got this question during an interview for a job.

1 Answers
Editor">Editor Staff answered 1 month ago

Correct answer is (a) True
 
To explain: We can create a mapping from string to a vector, where string would be the name of the vertex and vector would contains the name of the vertices to which it is connected.