Question: 1 . ( 1 5 points. ) Suppose that ( G ) is a directed graph. It has an adjacency structure G .
points. Suppose that G is a directed graph. It has an adjacency structure GAdj, a set of edges G E and a set of vertexes G V Each vertex v in G V has an attribute v m a r k in TRUE, FALSE It has no other attributes! In particular, it has no color, d f or pi attributes like Cormen's vertexes do
A vertex v in G V is an origin vertex in G if there is exactly one path from v to every other vertex in GV The word origin is meant to suggest that every vertex in G is reachable starting from v Don't bother looking for origin vertex online: the only hits you will get are irrelevant to this question: they deal with parabolas from highschool algebra.
Write a procedure ISORIGIN G u that returns TRUE if the vertex u is an origin in the graph G and returns FALSE otherwise. Your procedure must always terminate, even if G has cycles or self edges. You will lose many points if it uses vertex attributes other than mark.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
