Sunday, December 4, 2011

How to save the address of the root node in a binary tree (c++)?

Ok so I am implementing a maze game using binary trees. With every node traversal through the maze, the variable that holds the address of the root node is changed to the address of the present node. However, I need the original address of the root node after all the traversals have taken place. How do I get that address?|||You have to save a pointer to the root node when you first create it.

No comments:

Post a Comment