用c语言编写程序,实现单链表的建立(数据元素为1,2,3,4,5,6),遍历,查...答:void foo(struct node *a){ while (a->next != NULL){ printf("%d\t", a->val);a = a->next;} printf("\n");} // 插入 void insert(struct node *a, struct node *b, int n){ int i;for (i = 1; i < n - 1; i++)a = a->next;b->next = a->next;a->nex...
用c语言编写,实现单链表的建立(数据元素为1,2,3,4,5,6),遍历,查找,插 ...答:纯手工,自己调试的,望楼主加分,不懂可追问 include <stdio.h> include <malloc.h> typedef struct List { int data;List* next;}List;List* Init(int n){ List *p, *q, *head;int i = 0;q = (List*)malloc(sizeof(List));p = (List*)malloc(sizeof(List));head = (List*)m...