Exercise: Graphs
Find if an AdjacencyMatrix has a universal sink.
We'll cover the following
Task
A AdjacencyMatrix
, has a universal sink. Your algorithm should run in time.
Sample input
The sample input will be as follows:
(0, 4)
(1, 4)
(2, 4)
(3, 4)
(4, 4)
Expected output
The expected output will be as follows:
Universal Sink not found.
Vertex 4 is a Universal Sink in graph.
Create a free account to access the full course.
By signing up, you agree to Educative's Terms of Service and Privacy Policy