retagged by
571 views

1 Answer

2 votes
2 votes
We use queue for Breadth first search because

we need to store the nodes which see from the current node ( neighbouring nodes ) and need to be traversed those nodes in that order ( i.e we visit the nodes in breadth wise manner )

Since Queue is first in first out ( FIFO ) Data structure this will satisfy the requirements that we need
Answer:

Related questions

1 votes
1 votes
4 answers
2
4 votes
4 votes
2 answers
4