//建树
#include<iostream>
using namespace std;
typedef struct BiNode{
char data;
struct BiNode *lchild,*rchild;
}BiTNode,*BiTree;
void CreateBiTree(BiTree &T){
char ch;
cin>>ch;
if(ch=='#') T=NULL;
else{
T=new BiTNode
T->data=ch;
CreateBiTree(T->lchild);
CreateBiTree(T->rchild);
}
}
void main(){
BiTree tree;
cout<<"请输入建立二叉链表的序列:\n";
CreateBiTree(tree);
cout<<"所建立的二叉链表中序序列:\n";
InOrderTraverse(tree);
cout<<endl;
}
原文:https://www.cnblogs.com/ygjzs/p/11874580.html