1 2 3 4 5 6

typedef struct Tnode* NodePtr;

struct Tnode {
NodePtr left;
char data;
NodePtr right;
};

NodePtr Tree;

*

Note that left and right must be pointers to structures, they cannot be structure variables, otherwise we will have a structure that includes two copies of itself

IMAGE imgs/tree.sli01.gif

Commonly the data item itself is a pointer to another structure or string. Consider:

January 24, 1999

Page 5

copyright University of Alberta