Page 1 of 1

Time Lim Memory B. Determine connectivity of two vertex in DG(3150) Description + Subm Given a directed graph, You are r

Posted: Mon May 09, 2022 6:28 am
by answerhappygod
Time Lim Memory B Determine Connectivity Of Two Vertex In Dg 3150 Description Subm Given A Directed Graph You Are R 1
Time Lim Memory B Determine Connectivity Of Two Vertex In Dg 3150 Description Subm Given A Directed Graph You Are R 1 (101.68 KiB) Viewed 23 times
Time Lim Memory B. Determine connectivity of two vertex in DG(3150) Description + Subm Given a directed graph, You are required to design a function like: int connect(AdjList *G,char v1[],char v2[]); where v1 and v2 are two vertex, if there is path from v1 to v2, return 1, otherwise return 0. The Adjacency List data structure for DG as follows: #define MAXV 50 typedef struct _edgeNode { int adj; int w; _edgeNode *next; } EdgeNode; typedef struct_VertexNode{ char data[10]; EdgeNode head; } VertexNode; typedef struct { VertexNode vertex[MAXV]; int vn,en; }AdjList; In order to test your algorithm ,you may need the following functions: void createAdjList(AdjList *G); void OutputAdjList(AdjList *G); int Locate Vertex(AdjList *G,char v[]); Input first line enter 2 numbers for(nv,ne). second line enter the all vertex data (such ABC D...) start from third line, enter edge information, each edge is in form of v1 v2 w Where v1 is starting vertex and v2 is end vertex data, w is weight of the edge. separated by space. Last line enter two vertex to test if there is pass between them. Output output Yes or No in one line, without any space.
input 69 ABCDEF AB 3 AC3 BD 1 DA 2 2 с в 3 DC 5 CE 2 E D 4 DE 6 FA output No