#include<stdlib.h> typedef struct Node { int data; struct Node* next; }Node,Linklist; Linklist mergelist(Linklist *la, Linklist *lb) { Node* pa, * pb, * r, * t; Linklist* c = (Linklist*)malloc(sizeof(Node)); c->next = NULL; pa = la->next; pb = lb->next; while (pa != NULL && pb != NULL) { if (pa->data < pb->data) { t = pa; pa = pa->next; } if (pb->data < pa->data) { t = pb; pb = pb->next; } //尾插法将较小节点插入新的链表 t->next = c->next; c->next = t; }//无法排序部分处理 if (pa != NULL) r = pa; else r = pb; while (r != NULL)//剩余部分尾插法插入链表 { t = r; r = r->next; t->next = c->next; c->next = t; } }