I am a beginner in Java, and I need some help.
I am trying to implement Breadth First Search algorithm to solve a puzzle game (Unblock Me a game on Android). I am done with the GUI, but I am stuck with the algorithm.
So far I can count the available moves of each block, which supposed to be the children nodes of the root node. Each node (linkedlist) has the position of each block, and all the nodes are being stored in a Set.
What I need now is to mark each node as visited, so I don't get into an infinite loop.
I would appreciate any kind of help, and please correct me if I am mistaken with anything.
Thanks in advance :)
以上就是Implementing BFS in Java的详细内容，更多请关注web前端其它相关文章！