Algorithms, Depth First Search, Breadth First Search, Graph, Data Structures.
DFS, only the strategy of execution differs. BFS in action First we randomly select a vertex, here it is vertex ‘1’ and we look at 1’s neighbors which are ‘2’ and ‘3’. Then, we choose to visit ‘2’ and then we keep track of 2’s neighbors but we don’t visit them yet. Rather we choose to visit ‘3’ and