二叉树的生成,递归遍历以及动态转换为静态数组存储
一、本文内容
二叉树的生成,递归遍历以及动态转换为静态数组存储
二、具体代码
1.头部函数及结构体的定义
代码如下(示例):
#include<iostream>
using namespace std;
typedef struct Tree {
char date;
struct Tree* Lchild = NULL, * Rchild = NULL;
}Tree;//定义动态二叉树的结构
typedef struct {
char elem;
int Lc;
int Rc;
}
原创
2020-12-07 17:37:44 ·
514 阅读 ·
1 评论