2

So, here is your debugged code. Basically there were two main reasons why it was not working.... you were adding the node when it was not a target among the neighbors without checking whether that node is already in frontier. when you backtrack, the neighbor from where you backtrack, you have not declared that neighbor as a node yet. Without declaring it ...


Only top voted, non community-wiki answers of a minimum length are eligible