simple tree game implementation

I am trying to come up with an tree implementation capable of creating a tree based on a given pattern.

Something like this.
http://www.cs.cmu.edu/~adamchik/15-121/labs/HW-7%20Slide%20Puzzle/lab.html

[code]
class Tree{

char data[3][3];
Tree *left;
Tree *right;
Tree *up;
Tree *down
Tree *parent;
public:
Tree(char data[3][3]);
};
[\code]


I am not sure on How I make it create the whole tree from the constructor, without it creating the same node multiple times, or goes beyond the data size.
Last edited on
Topic archived. No new replies allowed.