C语言复习之简单的二叉树的仅输入输出操作
1:结构体
typedef struct TreeNode{
_Data value;
struct TreeNode * father;
struct TreeNode * right;
struct TeenNode * left;
}* pNode, Node;
2:函数声明
pNode createNode(_Data value);//创建节点
void printTree(pNode father);//树打印器
int getHigh(pNode father);//获得树高
void destoryTree(pNode father);//销毁树
void createByLeft(pNode father);//创建树
void printByFirst(pNode father);//先序打印
void printByCenter(pNode father);//中序打印
void printByEnd(pNode father);//后序打印
3:特殊变量声明
#define _Data char
#define _ArrayMaxSize 100
4:函数实现
pNode createNode(_Data value) {
pNode node = (pNode) malloc(sizeof(Node));
node->father = NULL;
node->left = NULL;
node->right = NULL;
node->value = value;
return node;
}
void createByLeft(pNode father) {
_Data value;
scanf("%c", &a