Question: C++ A node p of a directed graph G = (N;E) is called a sink node if for every node v 2 N and v
C++
A node p of a directed graph G = (N;E) is called a sink node if for every node v 2 N and v 6= p, the edge from v to p exists but the edge from p to v does not exist. Write an algorithm that can detect the presence of a sink in G in linear time (i.e., O(n)).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
