两个单链表求差集

两个单链表求差集


2024年4月30日发(作者:)

/******

//作者:cc

//功能:求A、B链表的差集

//日期:2012-05-12

*******/

#include

#include

//单链表类型定义

typedef struct node{

int data;

struct node *next;

}lnode,*linklist;

//创建有序非递减链表

linklist createlink(linklist l,int n)

{

int i=0;

linklist p,q,pre;

l=(linklist)malloc(sizeof(lnode));

l->next=0;

for(;i

pre=l;

p=l->next;

q=(linklist)malloc(sizeof(lnode));

printf("Input a element:");scanf("%d",&q->data);

while(p&&p->datadata){

pre=p;


发布者:admin,转转请注明出处:http://www.yc00.com/news/1714415648a2442097.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信