1 Answers

Option 2 : Queue

Breadth First Search uses a queue (First In First Out) and Depth first search uses a stack (First In Last Out).

BFS checks whether a vertex has been discovered before enqueueing the vertex rather than delaying this check until the vertex is dequeued from the queue.

4 views

Related Questions