简述以下算法的功能(顺序栈的元素类型为ElemType)。Void fun(SqStack *&st,ElemType x){ SqStack *tmps; ElemType e; InitStack(tmps); while(!StackEmpty(st)) { Pop(st,e); if(e!=x) Push(tmps,e); } while(!StackEmpty(tmps)) { Pop(tmps,e); Push(st,e); } DestroyStack(tmps);}
发布时间:2024-04-13 22:12:50