next up previous
Next: Up: Previous:

Representation

1.
Adjacency lists
2.
Adjacency matrix

1. Adjacency list

Array Adj of $\mid$V$\mid$ lists, O(E)
Adj[u] is a pointer to a list of vertices v such that (u,v)
$\in$ Edges

Memory O(V+E), Lookup O(E)



\psfig{figure=figures/f16-3.ps}



\psfig{figure=figures/f16-4.ps}


next up previous
Next: Up: Previous: