todo

Graph Representation

3 popular ways to implement:

  1. Adjacency list representation (most popular)
  2. Adjacency matrix representation
  3. Edge list representation
Adjacency List Representation

Use an array of vectors.

vector<int> adj[N];

The indices of the array represent the node number, while the actual value of the array are vectors of the other nodes that the current node is connected to.