#include
structStackRecord;
typedefstructStackRecord*Stack;
typedefcharElementType;
#defineEmptyTOS-1
#defineMinStackSize5
structStackRecord
{
intCapacity;
intTopOfStack;
ElementType*Array;
};
voidMakeEmpty(StackS)
S->TopOfStack=EmptyTOS;
}
intIsFull(StackS)
returnS->TopOfStack==S->Capacity;
intIsEmpty(StackS)
returnS->TopOfStack==EmptyTOS;
StackCreateStack(intMaxElements)
StackS;
/*1*/if(MaxElements
#include
#include
#include
#include
structStackRecord;
typedefstructStackRecord*Stack;
typedefcharElementType;
#defineEmptyTOS-1
#defineMinStackSize5
structStackRecord
{
intCapacity;
intTopOfStack;
ElementType*Array;
};
voidMakeEmpty(StackS)
{
S->TopOfStack=EmptyTOS;
}
intIsFull(StackS)
{
returnS->TopOfStack==S->Capacity;
}
intIsEmpty(StackS)
{
returnS->TopOfStack==EmptyTOS;
}
StackCreateStack(intMaxElements)
{
StackS;
/*1*/if(MaxElements