C++单链表的操作.pdfVIP

  • 2
  • 0
  • 约3.53千字
  • 约 4页
  • 2020-08-25 发布于河北
  • 举报
#includeiostream.h #includemalloc.h #includestdlib.h //#includesystem.h #define LIST_INIT_SIZE 100 #define OK 1 #define ERROR 0 #define OVERFLOW -2 #define NULL 0 typedef int ElemType; typedef int Status; typedef struct LNode{ ElemType data; struct LNode *next; }LNode,*LinkList; Status InitList(LinkList L) { L=new LNode; //L=(LNode *)malloc(sizeof(LNode)); if(!L)exit(OVERFLOW); L-next =NULL; return OK; } Status InsertList(LinkList L,int i,ElemType e)// 插入新结点 { LinkList p,s; int j=1; s

文档评论(0)

1亿VIP精品文档

相关文档