“a.h”
#include
#include
#include
#include
#define TRUE 1
#define FALSE 0
#define OK 1
#define ERROR 0
typedef int ElemType;
typedef int Status;
#define INIT_SIZE 10
#define STACKINCREMENT 2
typedef struct SqStack{
}SqStack;
"b.h"
#include"a.h"
Status InitStack(SqStack *s);
Status DestroyStack(SqStack *s);
Status ClearStack(SqStack *s);
Status StackEmpty(SqStack s);
Status StackLength(SqStack s);
Status GetTop(SqStack s,ElemType *e);
Status Push(SqStack *s ,ElemType e);
Status Pop(SqStack *s,ElemType *e);
Status StackTraverse(SqStack s,Status(*fun)(ElemType));
"b.c"
#include"b.h"
Status InitStack(SqStack *s)
{
}
Status DestroyStack(SqStack *s)
{
}
Status ClearStack(SqStack *s)
{
}
Status StackEmpty(SqStack s)
{
}
Status StackLength(SqStack s)
{
}
Status GetTop(SqStack s,ElemType *e)
{
}
Status Push(SqStack *s ,ElemType e)
{
}
Status Pop(SqStack *s,ElemType *e)
{
}
Status StackTraverse(SqStack s,Status(*fun)(ElemType))
{
}
"main.c"
#include"b.h"
#define LEN 5
Status fun(ElemType e)
{
}
int main()
{
链表学好之后,栈和队列就好写多了。
下面队列的干活
本文详细介绍了栈的基本概念、顺序栈的实现方法,并通过代码示例展示了如何使用栈进行数据存储与操作。同时,文章指出掌握链表知识后,栈和队列的实现将更加轻松。


793

被折叠的 条评论
为什么被折叠?



