Graph representations

How we represent a directed graph or undirected graph in an algorithm can effect the run time of an algorithm.

Bellow are some common ways to do this:

Data structureSpace complexityTime to check connectionTime to find neighbours
Adjacency list
Adjacency matrix
Edge list