您好,欢迎访问三七文档
StatusCreateSqList_L(LinkList&L,intn){L=(LinkList)malloc(sizeof(LNode);//建立表头结点L-next=NULL;last=L;//last为指向尾结点的指针for(i=0;in;++i){p=(LinkList)malloc(sizeof(LNode);scanf(&p-data);last-next=p;last=p;p-next=NULL;}}//CreateSqList_LCreateSqList_L(L,4)L(zhao,qian,sun,li)顺序输入n个元素创建带头结点的单链表(尾插法)StatusCreateSqList_L(LinkList&L,intn){L=(LinkList)malloc(sizeof(LNode);//建立表头结点L-next=NULL;last=L;//last为指向尾结点的指针for(i=0;in;++i){p=(LinkList)malloc(sizeof(LNode);scanf(&p-data);last-next=p;last=p;p-next=NULL;}}//CreateSqList_LCreateSqList_L(L,4)L(zhao,qian,sun,li)顺序输入n个元素创建带头结点的单链表(尾插法)-1^LStatusCreateSqList_L(LinkList&L,intn){L=(LinkList)malloc(sizeof(LNode);//建立表头结点L-next=NULL;last=L;//last为指向尾结点的指针for(i=0;in;++i){p=(LinkList)malloc(sizeof(LNode);scanf(&p-data);last-next=p;last=p;p-next=NULL;}}//CreateSqList_LCreateSqList_L(L,4)L(zhao,qian,sun,li)顺序输入n个元素创建带头结点的单链表(尾插法)-1^LlastStatusCreateSqList_L(LinkList&L,intn){L=(LinkList)malloc(sizeof(LNode);//建立表头结点L-next=NULL;last=L;//last为指向尾结点的指针for(i=0;in;++i){p=(LinkList)malloc(sizeof(LNode);scanf(&p-data);last-next=p;last=p;p-next=NULL;}}//CreateSqList_LCreateSqList_L(L,4)L(zhao,qian,sun,li)顺序输入n个元素创建带头结点的单链表(尾插法)-1^Llasti=0StatusCreateSqList_L(LinkList&L,intn){L=(LinkList)malloc(sizeof(LNode);//建立表头结点L-next=NULL;last=L;//last为指向尾结点的指针for(i=0;in;++i){p=(LinkList)malloc(sizeof(LNode);scanf(&p-data);last-next=p;last=p;p-next=NULL;}}//CreateSqList_LCreateSqList_L(L,4)L(zhao,qian,sun,li)顺序输入n个元素创建带头结点的单链表(尾插法)-1^Llasti=0pStatusCreateSqList_L(LinkList&L,intn){L=(LinkList)malloc(sizeof(LNode);//建立表头结点L-next=NULL;last=L;//last为指向尾结点的指针for(i=0;in;++i){p=(LinkList)malloc(sizeof(LNode);scanf(&p-data);last-next=p;last=p;p-next=NULL;}}//CreateSqList_LCreateSqList_L(L,4)L(zhao,qian,sun,li)顺序输入n个元素创建带头结点的单链表(尾插法)-1^Llasti=0zhaopStatusCreateSqList_L(LinkList&L,intn){L=(LinkList)malloc(sizeof(LNode);//建立表头结点L-next=NULL;last=L;//last为指向尾结点的指针for(i=0;in;++i){p=(LinkList)malloc(sizeof(LNode);scanf(&p-data);last-next=p;last=p;p-next=NULL;}}//CreateSqList_LCreateSqList_L(L,4)L(zhao,qian,sun,li)顺序输入n个元素创建带头结点的单链表(尾插法)-1Llasti=0zhaopStatusCreateSqList_L(LinkList&L,intn){L=(LinkList)malloc(sizeof(LNode);//建立表头结点L-next=NULL;last=L;//last为指向尾结点的指针for(i=0;in;++i){p=(LinkList)malloc(sizeof(LNode);scanf(&p-data);last-next=p;last=p;p-next=NULL;}}//CreateSqList_LCreateSqList_L(L,4)L(zhao,qian,sun,li)顺序输入n个元素创建带头结点的单链表(尾插法)-1Llasti=0zhaopStatusCreateSqList_L(LinkList&L,intn){L=(LinkList)malloc(sizeof(LNode);//建立表头结点L-next=NULL;last=L;//last为指向尾结点的指针for(i=0;in;++i){p=(LinkList)malloc(sizeof(LNode);scanf(&p-data);last-next=p;last=p;p-next=NULL;}}//CreateSqList_LCreateSqList_L(L,4)L(zhao,qian,sun,li)顺序输入n个元素创建带头结点的单链表(尾插法)-1Llasti=0zhaop^StatusCreateSqList_L(LinkList&L,intn){L=(LinkList)malloc(sizeof(LNode);//建立表头结点L-next=NULL;last=L;//last为指向尾结点的指针for(i=0;in;++i){p=(LinkList)malloc(sizeof(LNode);scanf(&p-data);last-next=p;last=p;p-next=NULL;}}//CreateSqList_LCreateSqList_L(L,4)L(zhao,qian,sun,li)顺序输入n个元素创建带头结点的单链表(尾插法)-1Llasti=1zhaop^StatusCreateSqList_L(LinkList&L,intn){L=(LinkList)malloc(sizeof(LNode);//建立表头结点L-next=NULL;last=L;//last为指向尾结点的指针for(i=0;in;++i){p=(LinkList)malloc(sizeof(LNode);scanf(&p-data);last-next=p;last=p;p-next=NULL;}}//CreateSqList_LCreateSqList_L(L,4)L(zhao,qian,sun,li)顺序输入n个元素创建带头结点的单链表(尾插法)-1Llasti=1zhao^pStatusCreateSqList_L(LinkList&L,intn){L=(LinkList)malloc(sizeof(LNode);//建立表头结点L-next=NULL;last=L;//last为指向尾结点的指针for(i=0;in;++i){p=(LinkList)malloc(sizeof(LNode);scanf(&p-data);last-next=p;last=p;p-next=NULL;}}//CreateSqList_LCreateSqList_L(L,4)L(zhao,qian,sun,li)顺序输入n个元素创建带头结点的单链表(尾插法)-1Llasti=1zhao^pqianStatusCreateSqList_L(LinkList&L,intn){L=(LinkList)malloc(sizeof(LNode);//建立表头结点L-next=NULL;last=L;//last为指向尾结点的指针for(i=0;in;++i){p=(LinkList)malloc(sizeof(LNode);scanf(&p-data);last-next=p;last=p;p-next=NULL;}}//CreateSqList_LCreateSqList_L(L,4)L(zhao,qian,sun,li)顺序输入n个元素创建带头结点的单链表(尾插法)-1Llasti=1zhaopqianStatusCreateSqList_L(LinkList&L,intn){L=(LinkList)malloc(sizeof(LNode);//建立表头结点L-next=NULL;last=L;//last为指向尾结点的指针for(i=0;in;++i){p=(LinkList)malloc(sizeof(LNode);scanf(&p-data);last-next=p;last=p;p-next=NULL;}}//CreateSqList_LCreateSqList_L(L,4)L(zhao,qian,sun,li)顺序输入n个元素创建带头结点的单链表(尾插法)-1Llasti=1zhaopqianStatusCreateSqList_L(LinkList&L,intn){L=(LinkList)malloc(sizeof(LNode);//建立表头结点L-next=NULL;last=L;//last为指向尾结点的指针for(i=0;in;++i){p=(LinkList)malloc(sizeof(LNode);scanf(&p-data);last-next=p;last=p;p-next=NULL;}}//CreateSqList_LCreateSqList_L(L,4)L(zhao,qian,sun,li)顺序输入n个元素创建带头结点的单链表(尾插法)-1Llasti=1zhaopqian^StatusCreateSqList_L(LinkList&L,intn){L=(LinkList)malloc(sizeof(LNode);//建立表头结点L-next=NULL;last=L;//last为指向尾结点的指针for(i=0;in;++i){p=(LinkList)malloc(sizeof(LNode);scanf(&p-data);last-next=p;last=p;p-next=NULL;}}//CreateSqList_LCreateSqList_L(L,4)L(zhao,qian,sun,li)顺序输入n个元素创建带头结点的单链表(尾插法)-1Llasti=2zhaopqian^StatusCreateSqList_L(LinkList&L,intn){L=(LinkList)malloc(sizeof(LNode);//建立表头结点L-next=NULL;last=L;//
本文标题:尾插法创建单链表
链接地址:https://www.777doc.com/doc-7065283 .html