网站大量收购独家精品文档,联系QQ:2885784924

链表教程(Linked list tutorial).doc

  1. 1、本文档共15页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
链表教程(Linked list tutorial)

链表教程(Linked list tutorial) / / dynamic establishment of the list, assuming that each node contains student learning and achievement, when the input number is 0, said the establishment of the list, the node should not be linked to the list, This program also includes a list / print and delete and insert operations #if (0) #includestdio.h The #includestdlib.h / sizeof function with the header file statement The #includemalloc.h / malloc function with the header file statement #define LEN sizeof (struct student) / / macro definition Struct student (*creat_list); / / custom declaration Void output (struct, student, *head); Struct, student, *del_list (struct, student, *head, int, dnum); Struct, student, *insert_list (struct, student, *head); Struct student / / define global structure { Int num; Float score; Struct student *next; }; Int n; / / global n Int main (void) { Struct student *stu; / / define a pointer to the structure student, the pointer function is used to receive the return address to create lists Struct student *pdel; / / define a pointer to the structure student, the pointer function to receive operation after the return address delete list Struct student *pinsert; / / define a pointer to the structure student, the pointer function to receive the return address insert node after operation Int dnum; / / dnum is used to define a variable input need to delete the node num Stu = (creat_list); / / call function, function is to create a linked list, and the function also returns to create the first address list, with the stu pointer variable to receive Output (stu); / / call function, function is to print out the data domain list each node to create the elements of the argument of the function for the structure of the first address Printf (please input to delete node dnum:); / / input need to delete the node number Scanf (%d, dnum); Pdel = del_list (stu, dnum); / / call function, this function is the function of a node to delete the list, the argument of this fun

文档评论(0)

f8r9t5c + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

版权声明书
用户编号:8000054077000003

1亿VIP精品文档

相关文档