The root of a directed acyclic graph is a vertex from which every other vertex in the graph can be reached by following a directed path. Define a function hasRoot that expects a LinkedDirectedGraph as an argument. This function determines whether or not the graph has a root. If this is true, the function should return the label of the root vertex; otherwise, the function should return None.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here