C++ Adjacency List Representation of Graphs

What is an efficient way to implement Adjacency List Representation of Graph in C++?

  1. vector *edges;
  2. list *edges;
  3. map<int, int> *edges;

In my opinion, it should be option 3, but I could not find any cons in using that…
Are there any?

Can someone please help me, which will be the most efficient way of implementing the Adjacency List and also for Competitive Programming?

Source: Windows Questions C++

LEAVE A COMMENT