int GetHead(Queue Q, DataType *e)
{
int i;
if(Q.stack_out->top==-1)
{
if(Q.stack_in->top==-1)
return 0;
else
while(Q.stack_in->top!=-1)
{Pop(Q.stack_in,&i);
Push(Q.stack_out,i);}
GetTop(*(Q.stack_out),e);
return 1;
}
else GetTop(*(Q.stack_out),e);
return 1;
}
int GetTop(Stack S, DataType *e)
{
if(S.top==-1)
{
return 0;
}
else {
*e=S.data[S.top];
return 1;
}
}