- Upvotes Received
- 1
- Posts with Upvotes
- 1
- Upvoting Members
- 1
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
3 Posted Topics
Here's how I did it, my empty environment is different though. My empty environment has a .name but it's initialized as None. so I just iterate through the environment, building the lists until None is reached and then I return the string without the extra comma at the end. [CODE] …
[CODE]if destination in visited: tmp = destination while tmp != source: push((tmp.row,tmp.column), stack) tmp = tmp.previous push((source.row,source.column), stack)[/CODE] Is how you push the coordinates to the stack as a tuple. "(source.row,source.column)" is the tuple. Also, what is node.coordinates? Your node class says nothing about coordinates...
Hey guys, just like the other graph/node problem on here, I too have a problem with graphs. The problem is as listed here: [URL="http://www.cs.rit.edu/~vcss241/Homeworks/08/AlternateDFS-stu.pdf"]http://www.cs.rit.edu/~vcss241/Homeworks/08/AlternateDFS-stu.pdf[/URL] and the pseudocode for what I'm trying to do is this: [QUOTE]DFSnodeWithDeletion( graph, node ): count the node itself for every neighbor of node: remove the …
The End.
LuckyX2