if I have this code :
#
node* search2(node **root, int val){
#
#
node* temp = *root;
#
if(temp -> value == val){
#
printf("found!\n");
#
printf("ang root nfaun ay nasa : %d \n", temp -> value);
#
printf("dapat tigil na.");
#
return temp;
#
}
#
#
if(temp -> left == NULL && temp -> right == NULL){
#
return NULL;
#
}else{
#
if(temp -> value > val){
#
search2(&(temp -> left), val);
#
}else{
#
search2(&(temp -> right), val);
#
}
#
}
#
}
what should I return? temp or *root? when I return temp, the value of the root doesn't change. I don't understand. thanks!