#include<stdio.h>
#include<stdlib.h>
#define STATUS int
#define FAIL 0
#define SUCCESS 1
typedef struct bstnode//定义排序二叉树结点结构体
{
int data;
struct bstnode *lchild,*rchild;
}bstnode,*bstptr;
void bitinsert(bstptr *thead,int elm)//二叉排序树插入节点
{
bstptr temp;
if (*thead==NULL)//没有后续节点
{
temp = (bstptr)malloc(sizeof(bstnode));
temp->data = elm;//初始化二叉树结点
temp->lchild = NULL;
temp->rchild = NULL;
*thead = temp;//完成节点插入;
}
else if(elm<(*thead)->data)
{
bitinsert(
二叉排序树的建立、结点插入及删除
最新推荐文章于 2023-05-06 00:28:43 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)