educative.io

Error in the theory

It says " Here, the word ‘backtrack’ means to move forward as long as there are no more nodes in the current path, then move backward on the same path to find nodes to traverse."

It should say “as long as there are nodes in the current path”


Course: https://www.educative.io/courses/algorithms-coding-interviews-python
Lesson: https://www.educative.io/courses/algorithms-coding-interviews-python/solution-depth-first-graph-traversal

Hi @Tugui_Mihail_Andrei,
This is Kanwal from Educative. I noticed your feedback in the course, “ Algorithms for Coding Interviews in Python" and I’m glad you reached out to us.

In your message, in the section Solution: Depth-First Graph Traversal, " It says " Here, the word ‘backtrack’ means to move forward as long as there are no more nodes in the current path, then move backward on the same path to find nodes to traverse."

It should say “as long as there are nodes in the current path”"

Backtrack means that when you are moving forward and there are no more nodes along the current path, you move backwards on the same path to find nodes to traverse. All the nodes will be visited on the current path till all the unvisited nodes have been traversed after which the next path will be selected.

The content in the lesson is accurate, and there’s no need for any changes.

Please do give it a check. We hope Educative has inspired you to further your learning, and please drop us a note if you have any other questions or concerns. Thank you!

Hello, I suppose it depends on what the word forward refers to. I initially thought that forward refers to forward in the current path, instead of the next available path once nodes in the current path are no longer available. It is a minor detail that I doubt would confuse anyone since DFS is easy to understand, but I do believe it could be rephrased differently as to not have even this little ambiguity.

Thank you for reviewing this!