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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

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

Post 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 24 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.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply