GATEverse
← GATE IT 2005

Q84b

MCQMarks unknown

A sink in a directed graph is a vertex i such that there is an edge from every vertex j≠ij \neq i to ii and there is no edge from ii to any other vertex. A directed graph GG with nn vertices is represented by its adjacency matrix AA, where A[i][j]=1A[i] [j] = 1 if there is an edge directed from vertex ii to jj and 00 otherwise. The following algorithm determines whether there is a sink in the graph GG. 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 E3E_3

Sign in to save attempts.

Loading…