[prev] 52 [next]

Graph ADT (Adjacency List)

Implementation of GraphRep (adjacency-list representation)

typedef struct GraphRep {
   Node **edges;      // array of lists
   int    nV;         // #vertices
   int    nE;         // #edges
} GraphRep;

typedef struct Node { // linked list node
   Vertex       v;
   struct Node *next; 
} Node;


[Diagram:Pic/graphRep3.png]