There are two methods in order to traverse a graph – BFS, DFS. Let’s say there is a graph problem to count the number of connected components. Here are the steps you can take.1. Build the graph2. Perform BFS or DFS3. Outer loop to check each unvisited node4. Number of calls to BFS or DFS READ MORE