nows is left with no unvisited adjacent nodes sowe dequeue and find from we have as unvisited adjacent node we mark it as visited and enqueue it at this stagewe are left with no unmarked (unvisitednodes but as per the algorithm we keep on dequeuing in order to get all unvisited nodes when the queue gets emptiedthe program is over