Computer scienceProgramming languagesJavaInterview preparationAlgorithms and problem solving techniques

Graph traversal: DFS vs BFS

The steps for DFS

Report a typo

The correct order for the steps of a Depth-First Search (DFS) algorithm is:

Put the items in the correct order
Visit the current node
Recursively visit the right subtree
Recursively visit the left subtree
Start from the root node
If the node is null, return
___

Create a free account to access the full topic