⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 linklist.h

📁 题目:A、B两个以单链表做存储结构的递增有序排列的链表合并为一个单链表做存储结构的递增有序链表C
💻 H
字号:
#include "iostream.h"
#include "malloc.h"

#define TRUE 1
#define FALSE 0
#define OK 1
#define ERROR 0
#define INFEASIBLE -1
#define OVERFLOW -2
#define NULL 0
typedef int Status;

typedef int ElemType;

typedef struct LNode{
	ElemType data;
	struct LNode *next;
}LNode,*LinkList;


void CreatList_L(LinkList &L,int n)
{
	LNode *p,*q;
	L=new LNode;
	L->next=NULL;  p=L;
	for(int i=0;i<n;i++)
	{
		cout<<"请输入第"<<i+1<<"个数:";
		q=new LNode;
		cin>>q->data; 
		q->next=p->next;  p->next=q;  p=q;
		cout<<endl;
	}
}

void PrintList_L(LinkList L)
{
	LNode *p;
	cout<<"输出链表:"<<endl;
    p=L->next;
	while(p!=NULL) 
	{
		cout<<p->data<<"  ";
	    p=p->next;
	}
	cout<<endl;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -