The indegreeof a vertex in a digraph is the number of directed edges that point to that vertex. The outdegreeof a vertex in a digraph is the number of directed edges that emanate from that vertex. No vertex is reachable from a vertex of outdegree 0, which is called a sink;a vertex of indegree 0, which is called a source,is not reachable from any other vertex. A digraph where self-loops are allowed andevery vertex has outdegree 1 is called a map(a function from the set of integers from 0 to V-1 onto itself). Write a program Degrees.java that implements the following API:

We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.