[prev] 37 [next]

Adjacency List Representation (cont)

Implementation of GraphRep

typedef struct vNode *VList;
struct vNode { Vertex v; vList next; };
typedef struct graphRep GraphRep;
struct graphRep {
   int   nV;     // #vertices
   int   nE;     // #edges
   VList *edges; // array of lists
};

[Diagram:Pics/graphs/graphRep3.png]