data structures using breadth-first search depth-first search while breadth-first search uses queue as an auxiliary data structure to store nodes for further processingthe depth-first search scheme uses stack but both these algorithms make use of variable status during the execution of the algorithmevery node in the graph will have the variable status set to or depending on its current state table shows the value of status and its significance table status value of status and its significance state of the node description ready the initial state of the node waiting node is placed on the queue or stack and waiting to be processed processed node has been completely processed breadth-first search algorithm breadth-first search (bfsis graph search algorithm that begins at the root node and explores all the neighbouring nodes then for each of those nearest nodesthe algorithm (fig explores their unexplored neighbour nodesand so onuntil it finds the goal that iswe start examining the node and then all the neighbours of are examined in the next stepwe examine step set status (ready statethe neighbours of neighbours of aso on and so forth this for each node in step enqueue the starting node means that we need to track the neighbours of the node and and set its status guarantee that every node in the graph is processed and no (waiting statenode is processed more than once this is accomplished step repeat steps and until queue is empty by using queue that will hold the nodes that are waiting step dequeue node process it for further processing and variable status to represent and set its status the current state of the node (processed statestep enqueue all the neighbours of that are in the ready state (whose status and set their status (waiting state[end of loopstep exit figure algorithm for breadth-first search figure adjacency lists abcd be cbg dcg ecf fch gfhi hei if graph and its adjacency list example consider the graph given in fig the adjacency list of is also given assume that represents the daily flights between different cities and we want to fly from city to with minimum stops that isfind the minimum path from to given that every edge has length of solution the minimum path can be found by applying the breadth-first search algorithm that begins at city and ends when is encountered during the execution of the algorithmwe use two arraysqueue and orig while queue is used to hold the nodes that have to be processedorig is used to keep track of the origin of each edge initiallyfront rear - the algorithm for this is as follows(aadd to queue and add null to orig front rear queue orig \