两个有序链表的合并
摘要:
主要要考虑有两个链表有交集的情况:#include <stdio.h>typedef struct Node{ struct Node *next; int value;}Node, *List;List merge(List a, List b){ Node *p, *pa, *pb, *prea; if(a == NULL || b == NULL) return; p = a; prea = a; pa = a->next; pb = b->next; while(pa && pb) { if(pa == pb) { pb = NULL; brea 阅读全文
posted @ 2011-07-23 10:15 宁静的水泡 阅读(11531) 评论(0) 推荐(0) 编辑