Q84b
MCQMarks unknownA sink in a directed graph is a vertex i such that there is an edge from every vertex to and there is no edge from to any other vertex. A directed graph with vertices is represented by its adjacency matrix , where if there is an edge directed from vertex to and otherwise. The following algorithm determines whether there is a sink in the graph . i = 0; do { j = i + 1; while ((j < n) && E1) j++; if (j < n) E2; } while (j < n); flag = 1; for (j = 0; j < n; j++) if ((j! = i) && E3) flag = 0; if (flag) printf("Sink exists") ; else printf ("Sink does not exist"); Choose the correct expression for
Sign in to save attempts.
Loading…