|
|
|
|
|
by squeaky-clean
1317 days ago
|
|
It still doesn't feel like a DFS though. It's not picking the next node in a consistent order. I wouldn't expect gaps between the search. This nerd-sniped me so I dug into the code, it's because it uses the non-recursive approach but it has an extra step of not adding neighbors to the stack if they've already been added previously. So you get this staggered line search because it avoids searching any tiles adjacent to a previously searched tile unless there are no other options. Decent optimization and still technically a DFS, it's just not the textbook example. |
|