#include<iostream>
using namespace std;
typedef int keytype;
typedef int infotype;
typedef struct
{
keytype key;
infotype otherinfo;
}elemtype;
typedef struct bstnode
{
elemtype data;//数据域
struct bstnode* lch, * rch;//左右孩子指针
}bstnode,*bstree;
bstree t;
bstree searchbst(bstree t, keytype key)//二叉排序树查找递归算法
{
if (!t||key==t->data.key)
{
return t;
}
else if (key < t->data.key)
{
return searchbst(t->lch, key);
}
else
{
return searchbst(t->rch, key);
}
}
int main()
{
return 0;
}
树表的查找二叉排序树
最新推荐文章于 2024-09-12 19:02:20 发布