二叉树
Student search_student (Student root , char *name){
Student p;
if (root)
{
if (strcmp (name , root->name) < 0)
{
//return search_student (root->left , name);
p = search_student (root->left , name);
return p;
}
if (strcmp (name , root->name) > 0)
{
//return search_student (root->right , name);
p = search_student (root->right , name);
return p;
}
}
return root;
}
这个是二叉排序树查找的函数,我实在搞不懂为什么一定要返回p 的值,而p 的值又是哪个的值。这递归搞得我好晕。哪位大神能帮帮我啊