Which data structures are used for BFS and DFS of a graph?

Data Structure >   Graph >   Graph in Data Structure  

Short Question

10992


Answer:

  • Queue is used for BFS
  • Stack is used for DFS. DFS can also be implemented using recursion (Note that recursion also uses function call stack).


This Particular section is dedicated to Question & Answer only. If you want learn more about Data Structure. Then you can visit below links to get more depth on this subject.




Join Our telegram group to ask Questions

Click below button to join our groups.