怎么样判断一棵二叉树是完全二叉树
											请用C语言解答,小弟万分感谢!!!!!!急急										
					
	
				
											typedef struct node //类型定义
  {
   DataType data;
   struct node *lchild,*rchild;
   }BTNode;
int PerBitree(BTNode * t)//当前层的个数不等于上一层的2倍且当前层的最后一个结点不是二叉树的最后一个结点,则不是完全二叉树;
  {
   int front=1,rear=1,last;
   int temp=0.5,count=0;
   BTNode Q[];
   Q[rear++]=t;
   last=rear;
  while(front<rear)
    {
    q=Q[front++];
    count++;
    if(q->lchild!=NULL) Q[rear++]=q->lchild;
    if(q->rchild!=NULL) Q[rear++]=q->rchild;
    if(front>=last)
      {
        if(count!=temp*2&&q->lchild==NULL&&q->rchild->NULL) return 0;
        temp=count;
       }
    return 1;
     }
   }
//只是算法不能运行										
					
	
	
	
	      


											
	    

	