文章
72
粉丝
142
获赞
5
访问
57.6k
#include<iostream>
#include<cstring>
#include<string>
#include<queue>
using namespace std;
typedef struct Tnode {
char data;
struct Tnode* lchild, * rchild;
}Tnode, * Tree;
void createNode(Tree &T,char c) {
T = (Tnode*)malloc(sizeof(Tnode));
T->data = c;
T->lchild = NULL;
T->rchild = NULL;
}
void createTree(Tree &T,string str,int& position) {
queue < Tree> q;
if (str[position] != '#') {
createNode(T,str[position++]);
q.push(T);
}
while (!q.empty()) {
Tree current = q.front();
if (str[position] != '#') {
&nb...
登录后发布评论
ABC#D####