#include #include #include "QueueTypes.h" #include "StackInterface.h" void InitializeStack(Stack *S) { S->Count = 0; } int Empty(Stack *S) { return (S->Count == 0); } int Full(Stack *S) { return (S->Count == MAXSTACKSIZE); } void Pop(ItemType *X, Stack *S) { if (S->Count == 0) { printf ("Attempt to pop the empty stack"); return; } else { --(S->Count); *X = S->Items[S->Count]; } } extern void Push(ItemType X, Stack *S){ if (S->Count == MAXSTACKSIZE) { printf ("Attempt to push a new element onto a full stack"); return; } else { S->Items[S->Count] = X; ++(S->Count); } }