hello all,
here is a question
i've made a function that accepts a pointer to a node and finds the level of the node in the tree.write a c-function that accepts a pointer to a binary tree & a pointer to a node of the tree and returns the level of the node in the tree.
my problem is that how can i make a function that should accept another pointer to the tree and returns the level.and also i'm not able to understand what does a pointer to a tree means.is it an array of nodes.Code:int level(struct node *p) { int level=0; struct node *r; for(r=p;r->father!=NULL;r=p->father) level++; return(level); }
thanks