Hello all :) Today I am refining my skills on graph theory and data structures. I decided to do a small project in C++ because it\'s been a while since I\'ve worked in C++
I would recommend the more general and simple approach of using vector and pairs: #include #include
typedef std::pair ii; /* the first int is for the data, and the second is for the weight of the Edge - Mostly usable for Dijkstra */
typedef std::vector vii;
typedef std::vector WeightedAdjList; /* Usable for Dijkstra -for example */
typedef std::vector AdjList; /*use this one for DFS/BFS */
Or alias style (>=C++11):
using ii = std::pair;
using vii = std::vector;
using vi = std::vector;
using WeightedAdjList = std::vector;
using AdjList = std::vector;
From here: using vector and pairs (from tejas's answer)
For additional information you can refer to a very good summary of topcoder: Power up c++ with STL