/Graph_Traverse

Algorithms lab material

Primary LanguageC++

BFS & DFS Graph traversal

This a simple code for traversing graphs using two different methods

BFS

Breadth-first search is an algorithm for searching a tree data structure for a node that satisfies a given property. It starts at the tree root and explores all nodes at the present depth prior to moving on to the nodes at the next depth level.
Data structure used: Queue

DFS

Depth-first search is an algorithm for traversing or searching tree or graph data structures. The algorithm starts at the root node and explores as far as possible along each branch before backtracking.
Data structure used: Stack

C++


STL:Vectors
Queue
Stacks