#include <iostream>
using namespace std; #define MaxSize 50 typedef int ElementType;
typedef struct { ElementType data[MaxSize]; int top; } SqStack;
void InitStack(SqStack &s) { s.top = -1; }
bool StackEmpty(SqStack &s) { if (s.top == -1) return true; else return false; }
bool PushStack(SqStack &s, ElementType x) { if (s.top + 1 == MaxSize) return false; s.data[++s.top] = x; return true; }
bool PopStack(SqStack &s, ElementType &x) { if (s.top == -1) return false; x = s.data[s.top--]; return true; }
bool GetTop(SqStack s, ElementType &x) { if (s.top == -1) return false; x = s.data[s.top]; return true; }
typedef struct LinkNode { ElementType data; struct LinkNode *next; } *LiStack;
int main() {
return 0; }
|