We are using the adjacency list representation of the directed graph from the previous recipe, Creating an adjacency list representation of a directed graph:
The temp1 pointer is set to point to startList. That is, temp1 is pointing to the node with vertex a. If temp1 is not NULL, the node pointed to by the temp1 pointer is added to the queue. The rear variable, which is -1 at the moment, is incremented to 0 and the a node is added to the array of que nodes at index location 0. Because the value of the front index location is -1 currently, the front is also set to 0, as follows:
Thereafter, the dequeue ...