代码所有结点释放空间实验二.docxVIP

  • 13
  • 0
  • 约3.93千字
  • 约 11页
  • 2022-05-12 发布于贵州
  • 举报
#include?stdio.h #include?stdlib.h #includestring.h typedef?struct?node?? { char?data[10];???? struct?node?*next;??? }ListNode; typedef?ListNode?*?LinkList;?? //==========用尾插入法建立带头结点的单链表=========== LinkList?CreatListR1(??) { char?ch[100],ch1[10],c; int?i=0,j=0; LinkList?head=(LinkList)malloc(sizeof(ListNode));?//生成头结点 ListNode?*s,*r; r=head; r-next=NULL; printf(Input?#?to?end??);??//输入#代表输入结束 printf(Please?input?Node_data:); scanf(%s,ch);???????????//输入各结点的字符串 do { c=*(ch+i++); *(ch1+j++)=c; if(c==apos;,apos;) { s=(LinkList)malloc(sizeof(ListNode)); for(j=0;(j10)*(ch1+j)!=apos;,apos;;j++)?*(s-

文档评论(0)

1亿VIP精品文档

相关文档