{ struct node*create1();/*尾插法建立单链表*/ struct node*create2();//头插法建立单链表 int length(struct node*head);//返回单链表的长度,并输出各节点的值 struct node*head1,*head2; head1=create1(); head2=create2(); int leng1=length(head1); printf("\n"); printf("单链表1的长度...
单链表(头插法,尾插法创建,顺序输出链表,并返回链表长度)代码如下:#include <stdio.h> #include <stdlib.h> #define LENG sizeof(struct node)//结点所占单元数 struct node{ int data; struct node *next;};int main(){ struct node*create1();/*尾插法建⽴单链表*/ struct ...