/*一、实验题目
1.设有两个无头节点的单链表,头指针分别为ha和hb,链中有数据域data,链域next,
两链表的数据都按递增序存放,现要求将hb表归到ha表中,且归并后ha仍递增序,
归并中ha表中已有的数据若hb中也有,则hb中的数据不归并到ha中,hb的链表在算法中不允许破坏。*/
#include<stdio.h>
#include<stdlib.h>
//判断数据n是否在头指针为head的链表中出现,出现则返回true,否则返回false
bool isExist(struct intNode *head,int n);
//建立一个先进先出的链表
void createStack(struct intNode **headp);
//给头指针为head的链表冒泡排序
void sortchain(struct intNode *head);
//输出头指针为head的链表
void output(struct intNode *head);
struct intNode
{
int data;
struct intNode *next;
};
bool isExist(struct intNode *head,int n)
{
struct intNode *p=NULL;
p=head->next;
while(p!=NULL)
{
if(p->data==n)
return true;
p=p->next;
}
return false;
}
void