View Single Post
Old Sep 18th, 2004, 8:06 PM   #6
sarumont
Hobbyist Programmer
 
sarumont's Avatar
 
Join Date: Apr 2004
Location: /dev/urandom
Posts: 154
Rep Power: 5 sarumont is on a distinguished road
Send a message via ICQ to sarumont Send a message via AIM to sarumont Send a message via Yahoo to sarumont
I've looked at something like that with a friend. This was before I had really done any higher-level coding. We were trying to implement either a BFS or DFS in C using linked-lists to traverse the tree.

I think that this would work pretty well. It will not be optimal, as per the definition, but it should provide you with a working program. You would have to determine which nodes you could visit from the current (the 2D array would help there) and follow them. I like the DFS > BFS in this case because you will traverse a whole path before starting on the next, rather than traversing each path at the same time.

Good luck!
__________________
"Time is an illusion. Lunchtime doubly so."
-the late, great Douglas Adams
sarumont is offline   Reply With Quote