一.链表
1.对栈的模型要熟悉,既先进后出
2.对链表的操作要熟悉
3.搞清楚这两个数据模型
typedef struct node
{
int data;
struct node *next;
}node;
typedef struct stack
{
int count;//栈的深度
node *top;//栈顶
}stack;
二.数组的方式
typedef struct stack
{
int data[maxsize];
int top;
}strack;
strack s;
栈空
s->top = 0;
栈满
s->top = maxsize -1;
阅读(1442) | 评论(0) | 转发(0) |