> if(p->left !=NULL && p->right !=NULL)
Yeah, you missed the possibility that one of the branches could be NULL without the other branch being NULL.
So you only print nodes which have both children present.
> if(p->left !=NULL && p->right !=NULL)
Yeah, you missed the possibility that one of the branches could be NULL without the other branch being NULL.
So you only print nodes which have both children present.
okay buds I give up can anybody just send me in the right direction at all with this whole leaf thing. I'm lost all of the algorithms I've tried fail miserably. So please be merciful and throw me a bone here.