I am writing a program in c which traverse a tree in in-order, pre-order and post-order . this code is not compiling properly . it shows a error saying "unknown type name 'node'"
struct node
{
int value;
node* left;
node* right;
};
struct node* root;
struct node* insert(struct node* r, int data);
void inOrder(struct node* r);
void preOrder(struct node* r);
void postOrder(struct node* r);
what i am missing ?
change inside structure
struct node
{
int value;
struct node* left; //Changed
struct node* right;
};
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With