I have 1 node:
struct node *left, *right;
typedef, both the declarations are illegal.
typedef struct node node;
in place, there's no difference. Both the statements declare a variable
node1 of type pointer to
node. (Note: You'll still be needing the terminating
It's a matter of choice, but some (including me) prefer to attach the pointer notation to the variable, to avoid misunderstanding, in case of multiple variable declaration, like
node *p, q;
p is pointer type, but
q is not.
Writing it like
node* p, q;
may create the illusion that
q both are of pointer type, where, in essence, they are not.