2

This is the struct of adjList

typedef struct _node
{
    int weight;
    int label;
    struct _node *next;
} EdgeNode;
typedef struct _vnode
{
    int id;
    EdgeNode *firstedge;
} VertexNode;
typedef VertexNode AdjList[MAX];

The graph is loop-free, and the input is a node whose in-degree is zero.
How to traverse(output) all paths of this graph?

for example, the adjList is
1->2->3
2->4
3->4

the output is
path_1: 1->2->4
path_2: 1->3->4

Eric Zhan
  • 21
  • 1

0 Answers0