- 3
- 0
- 约3.45千字
- 约 6页
- 2018-04-27 发布于河南
- 举报
单链表程序设计
#include iostream
#include conio.h
using namespace std;
typedef int datatype;
typedef struct NODE * pointer;
struct NODE {
datatype data;
pointer next;
};
typedef pointer lklist;
lklist initlist() {
pointer L;
L=new NODE;
L-next=NULL;
return L;
}
void creat1(lklist L) { //头插建表
pointer s; char ch;
L=new NODE; //生成头结点
L-next=NULL;
while(cinch,ch!=$) {//输入并检测结束
s=new NODE; //生成新结点
s-data=ch; //装入数据
s-next=L-next;
L-next=s; //插到头结点后
}
}
void creat2(lklist L) { //尾插建表
pointer rear,s; char ch;
L=new NODE; //生成头结点
rear=L; //尾指针初值
while(cinch,ch!=$) { //读入并检测结束
s
您可能关注的文档
最近下载
- 变频器技术考试题及答案.docx VIP
- 重症患者的肠内营养护理.pptx VIP
- 输液泵操作评分标准.doc VIP
- 青少年焦虑症护理查房.pptx VIP
- 试析《三国演义》在日本动漫中的传播与接受.pdf VIP
- 从吉川英治《三国志》看《三国演义》在日本的传播与接受The Spread and Reception of the Romance of the “Three Kingdoms” in Japan from the “Three Kingdoms” by Yoshikawa Eiji-来源:现代语言学(第2022002期)-汉斯出版社.pdf VIP
- 与总承包单位协调配合措施方案.docx VIP
- 《清静经》全文及译文.pdf VIP
- 与总承包单位协调配合措施方案.docx VIP
- 线线角、线面角、面面角专题.pdf VIP
原创力文档

文档评论(0)