43. The data structure required for Breadth First Traversal on a graph is?

a) Stack
b) Array
c) Queue
d) Tree

Answer: c
Explanation: In Breadth First Search Traversal, BFS, starting vertex is first taken and adjacent vertices which are unvisited are also taken. Again, the first vertex which was added as an unvisited adjacent vertex list will be considered to add further unvisited vertices of the graph. To get the first unvisited vertex we need to follows First In First Out principle. Queue uses FIFO principle.

Leave a Reply

Your email address will not be published.