首页 > 代码库 > PAT1020 一个case出现段错误,可是我找不到

PAT1020 一个case出现段错误,可是我找不到

//PAT1020 二叉树 建树 层序遍历#include<stdio.h>#include<stdlib.h>#include <iostream>#include <queue>using namespace std;typedef int ElementType ;typedef struct TNode *Position;typedef Position BinTree;struct TNode{	ElementType Data;	BinTree Left;	BinTree right;};Position BuildTree(ElementType InOrder[],ElementType PostOrder[],int n){	if(n==0)	return NULL;	 	struct TNode* root=(struct TNode*)malloc(sizeof(struct TNode));	root->Data=http://www.mamicode.com/PostOrder[n-1];"%d",T->Data);		}		else		printf(" %d",T->Data);		if(T->Left) q.push(*T->Left);		if(T->right) q.push(*T->right);	}	};int main(){		int n;		ElementType PostOrder[300],InOrder[300];		scanf("%d",&n);		for(int i=0;i<n;i++)	    scanf("%d",&PostOrder[i]);	    for(int i=0;i<n;i++)	    scanf("%d",&InOrder[i]);	    	    Position root=BuildTree(InOrder,PostOrder,n);	    LeverOrderTraversals(root);	    	    return 0;}

  

PAT1020 一个case出现段错误,可是我找不到