创建如下二叉树:
//创建上面的二叉树代码实现如下
#include<stdio.h>
#include<stdlib.h>
#include<malloc.h>
struct BTNode * CreateBTree();
struct BTNode
{
char data;
struct BTNode *pLchild;//p是指针 L表示左 child是孩子
struct BTNode *pRchild;//p是指针 R表示右,child是孩子
};
int main(void)
{
struct BTNode *pT=CreateBTree();
return 0;
}
struct BTNode * CreateBTree(void)
{
struct BTNode *pA=(struct BTNode*)malloc(sizeof(struct BTNode));
struct BTNode *pB=(struct BTNode*)malloc(sizeof(struct BTNode));
struct BTNode *pC=(struct BTNode*)malloc(sizeof(struct BTNode));
struct BTNode *pD=(struct BTNode*)malloc(sizeof(struct BTNode));
struct BTNode *pE=(struct BTNode*)malloc(size