Consider directed graph G =(V,E) which has vertices and edges. Firstly, perform the reversal of graph that is . Let’s perform the reverse of the graph by changing the directions of edges that are connected to the vertex. After the reversal of the graph all the edges reversed that is, is shown in the figure below.

The degree of a node in a directed graph is the number of edges connected to the node. For each node in a graph there is a list. It will take a linear time in adjacency list and it always assign a degree value to each node. And while iterating from the list the total number of the vertex is the degree of the vertex. After reversal of the graph take the adjacency list and put all the vertices in the adjacency list one by one.
Draw the Reversal of the directed graph:

Adjacency list for directed graph is shown below:

As in this directed graph it contains five vertices so the size of the adjacency list here is five. After that as known that the graph is the directed graph so, the vertex connected by edges to the other vertex writes only those vertices in front of the list that take a temp as a variable for storing the temporary variable while traversing the directed graph to the adjacency list. Like here vertex one is connected by vertex two and vertex two is connected to vertex three like that mark in the adjacency list. Here each vertex has one linked list. After performing this step now, the graph contained the adjacency list. Where the time complexity is O (V+E) . Hence it is proved that this is a linear-time algorithm that takes O (V+E) time.