Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements
Ranked #107.84K
~3K People Reached
Favorite Forums
Favorite Tags
c++ x 1

1 Posted Topic

Member Avatar for peachslasher

There's my version of returning the parent node: Tree* findParent(Tree *t,int data){ if(data==t->data){ return NULL;//because this is the root }else if((t->left!=NULL && data==t->left->data ) || ( t->right!=NULL && data==t->right->data)){ return t; }else if(data<t->data){ return findParent(t->left,data); } else if(data>t->data){ return findParent(t->right,data); } } It really works:)

Member Avatar for che-burator
0
3K

The End.