Computer scienceProgramming languagesJavaInterview preparationAlgorithms and problem solving techniques

Graph traversal: DFS vs BFS

Match the graph traversal algorithm or concept

Report a typo

Match the graph traversal algorithm or concept in Column 1 with its corresponding description in Column 2.

Match the items from left and right columns
Depth-First Search (DFS)
Breadth-First Search (BFS)
Cycle Detection using DFS
BFS for finding shortest path
A method to detect a cycle in a graph by marking each visited vertex and keeping track of the vertices in the current recursion stack
An algorithm that finds the shortest path in a graph by exploring all the nodes at the current level before moving to the next level
An algorithm that explores as far as possible along each branch before backtracking
An algorithm that explores all the neighbor nodes at the present depth before moving on to nodes at the next depth level
___

Create a free account to access the full topic