二叉树
这问题该怎么解决
typedef int ElemType;
typedef struct BiTNode {
ElemType data; //数据域
struct BiTNode* lchild, * rchild; //左右孩子指针
}BiTNode,*BiTree;
bool Push(SqStack& S, ElemType x) //入栈
{
if (S.top == MaxSize - 1) //判断是否栈满
return false;
S.data[++S.top] = x;
return true;
}
bool Pop(SqStack& S, ElemType &x) //弹出栈元素
{
if (StackEmpty(S))
return false; //栈为空
x = S.data[S.top--];
return true;
}
void InOrder2(BiTree T)
{
SqStack S;
InitStack(S);
BiTree p = T;
while (p || !StackEmpty(S))
{
if (p)
{
Push(S, p); //1
p = p->lchild;
}
else
{
Pop(S, p); // 2
putchar(p->data);
p = p->rchild;
}
}
}
1处 错误 C2664 “bool Push(SqStack &,ElemType)”: 无法将参数 2 从“BiTree”转换为“ElemType”
2处 错误 C2664 “bool Pop(SqStack &,ElemType &)”: 无法将参数 2 从“BiTree”转换为“ElemType &”