#include <stdio.h>
#include<stdlib.h>
#include <conio.h>
#include <string.h>
typedef char DataType;
typedef struct node
{
DataType data; // 数据域
int ltag, rtag; // 线索标记
struct node *lchild, *rchild; // 左,右孩子
}BiTnode;
typedef BiTnode * BinTree;
/*
// 创建二叉树 参数接收为数组
void CreateBiTree(BinTree *T,char *&s,int &i)
{
char ch = s[i];
if (ch == '#')
{
*T = NULL;
}
else
{
*T = (BiTnode *)malloc(sizeof(BiTnode));
(*T)->data = ch;
i++;
printf(" 字符%c\n",ch);
CreateBiTree(&(*T)->lchild,s,i); //建立左子树
i++;
CreateBiTree(&(*T)->rchild,s,i); //建立右子数
}
}
*/
// 创建二叉树 参数接收为数组
void CreateBiTree(BinTree *T, char *&s)
{
char ch = *s;
if (ch == '#')
{
*T = NUL
二叉树建立,遍历,搜索,中序线索化
最新推荐文章于 2023-05-08 11:01:56 发布
![](https://img-home.csdnimg.cn/images/20240611030827.png)