博客
关于我
猴子选大王(循环单链表)
阅读量:395 次
发布时间:2019-03-05

本文共 611 字,大约阅读时间需要 2 分钟。

 

#include
#include
struct Node{ unsigned long number;//存储某只猴子的编号 struct Node *next;//指向下一猴子结点的指针};struct Node *head;//全局头指针struct Node *start;//全局指针, 表非空时指向表的第一个结点; 否则指向头结点struct Node *rear;//全局尾指针, 表非空时指向表的最后一个结点; 否则指向头结点void create_List()//创建循环链表{ head=(struct Node*)malloc(sizeof(struct Node)); head->number=0;//头结点的数据域存储当前猴子的数量 head->next=head;//表空 start=head; rear=head; return ;}void insert_Elem(unsigned long n)//向链表中插入结点{ struct Node *p; p=(struct Node*)malloc(sizeof(struct Node)); if(head->number==0)//表空 { start=p;//修改开始元素指针 } // p->

转载地址:http://xusg.baihongyu.com/

你可能感兴趣的文章
new 一个button 然后dispose,最后这个button是null吗???
查看>>
NewspaceGPT的故事续写能力太强了
查看>>
NewspaceGPT绘制时序图
查看>>
NewspaceGPT绘制类图
查看>>
new一个对象的过程
查看>>
new和delete用法小结
查看>>
new对象时,JVM内部究竟藏了什么小秘密?
查看>>
new操作符的实现原理
查看>>
Next.js React Server Components 教程
查看>>
NextGen Mirth Connect XStream反序列化远程代码执行漏洞(CVE-2023-43208)
查看>>
next项目部署到服务器pm2进程守护
查看>>
nexus 介绍
查看>>
nexus上传jar
查看>>
Nexus指南中的更新强调集成和透明度的重要性
查看>>
Nexus指南已经发布
查看>>
Nexus(1):Nexus的安装与配置
查看>>
NFC技术:概述
查看>>
NFinal学习笔记 02—NFinalBuild
查看>>
NFS
查看>>
nfs mount 故障 mount.nfs: access denied by server while mounting 10.0.100.208:/backup_usb
查看>>