- --
-
- --
-
- . -word资料-
. z.
printf("链栈空!!\n");
return 0;
}
else
{
*=s->top->data;
printf("当前链栈的栈顶元素为%d",*);
return 0;
}
} top
*
an
a1 ^
an
an-1
a1
toptop
1,入栈示意图 2,出栈示意图
- --
-
- . -word资料-
. z.
开场
ElemType *;
s->tope==0
Printf("栈空,不能出栈")
*=p->data
s->top=p->ne*t;delete p;
return *;
完毕
ElemType *;
开场
s->top==0
Printf("链栈为空
*=s->top->data;
return o;
return o
完毕
3,出栈 4,取栈顶元素
- --
-
- . -word资料-
. z.
调试分析:
在调试中出现以上错误,经过查找原程序发现scanf("%d",&cord);中少填写了地址符。
在调试中出现了初始化以后,没有在主菜单中选择操作就直接运行入栈了,经过查找原程序发现在swich语句中少了break。
- --
-
- . -word资料-
. z.
测试结果:
实验成绩:
- --
-
- . -word资料-
. z.
实验题目:
实验日期:
实验要求:
概要设计:
- --
-
- . -
栈的链式存储结构的表示和实现实验报告 来自淘豆网m.daumloan.com转载请标明出处.