Question: Let G=(V,E) be a directed graph with n vertices. A vertex s is a drain if, for every v in V except for s, thre

Let G=(V,E) be a directed graph with n vertices. A vertex s is a drain if, for every v in V except for s, thre is an edge from v to s, and there is no edge from s to v. Give an O(n) algorithm to determine whether or not G has a drain assuming that G is given by its n by n adjacency matrix.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!