#include<stdio.h>
#include<string.h>
#define MAX 100
typedef struct TNode
{
int data;
TNode *left, *right;
}TNode;
typedef struct QNode
{
TNode *tNode;
QNode *next;
int level;
}QNode;
typedef struct Queue
{
QNode *front;
QNode *rear;
}Queue;
int count[MAX];
int level = 0;
int InitTree(TNode *&root)
{
int value;
scanf("%d", &value);
if(value == 0)
root = NULL;
else
{
root = new TNode;
if(root == NULL)
return -1;
root->data = value;
InitTree(root->left);
InitTree(root->right);
}
return 0;
}
int InitQueue(Queue *&qu)
{
qu = new Queue;
if(qu == NULL)
return -1;
qu->front = qu->rear = new QNode;
if(qu->front == NULL)
return -1;
qu->front->tNode = NULL;
qu->front->next