数组栈
完成void MakeEmpty(Stack S)函数,该函数把栈置空(但不释放空间)。
完成Stack DisposeStack(Stack S)函数,该函数销毁数组栈(释放数组空间与栈空间),返回NULL指针。
typedef int ElemType;
struct StackRecord;
typedef struct StackRecord *Stack;
struct StackRecord
{
int Capacity; //栈容量
int Top; //栈顶,初始为1
ElemType *Array;
};
void MakeEmpty(Stack S)
{
S‐>Top=‐1;
}
Stack DisposeStack(Stack S)
{
S‐>Top=‐1;
free(S);
return