# Solution: Graphs

Review the solution code that finds a universal sink in an AdjacencyMatrix.

## We'll cover the following

## Task

A *universal sink*`AdjacencyMatrix`

, has a universal sink. This algorithm runs in $O(n)$ time.

## Solution

Here is the code that finds the universal sink in a graph $G$. It consists of the method `findUniSinkOn()`

which is used to find a universal sink in a directed graph.

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy