链式栈的初始化与入栈出栈.docxVIP

  • 8
  • 0
  • 约1.61千字
  • 约 2页
  • 2021-10-13 发布于内蒙古
  • 举报
链式栈的初始化与入栈出栈 #include #include #define OK 1 #define ERROR 0 #define OVERFLOW -1 typedef int Status; typedef int SElemType; typedef struct node{ SElemType data; struct node *next; }SLnode,*SLinkList; typedef struct { SLinkList top,base; int len; }S_LinkList; Status Build_S(S_LinkList S) { int x; SLinkList p,q; printf(\请输入数据,以-1结束:\\n\ S.top=(SLinkList )malloc(sizeof(SLnode)); S.base=(SLinkList )malloc(sizeof(SLnode)); S.top-next=S.base; q=S.base; S.len=0; while(scanf(\ { p=(SLinkList )malloc(sizeof(SLnode)); p-data=x;

文档评论(0)

1亿VIP精品文档

相关文档