C programming language Graph Structure -
i have trouble building graph structure. know how build linked list , doubly too. want construct graph structure in site (the pic. output) http://www.cs.sunysb.edu/~algorith/files/graph-data-structures.shtml
you have 3 common solutions:
- an adjacency matrix (in store matrix of
n*nn number of vertices , inmatrix[x][y]store value ifxhas edgey, 0 otherwise - an edge list, in keep long lists of edges if couple
(x,y)in list, there edge x y - an adjacency list, in have list of vertices , every vertex
xhas list of edges nodes x has edge to.
every different approach or bad according to
- space required
- computational complexity related specific operations more other
so according need graph choose of those. if want know specific characteristic of above possible implementations take @ answer question.
Comments
Post a Comment