博客
关于我
猴子选大王(循环单链表)
阅读量: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/

你可能感兴趣的文章
nginx 开启ssl模块 [emerg] the “ssl“ parameter requires ngx_http_ssl_module in /usr/local/nginx
查看>>
Nginx 我们必须知道的那些事
查看>>
Nginx 源码完全注释(11)ngx_spinlock
查看>>
Nginx 的 proxy_pass 使用简介
查看>>
Nginx 的 SSL 模块安装
查看>>
Nginx 的优化思路,并解析网站防盗链
查看>>
Nginx 的配置文件中的 keepalive 介绍
查看>>
Nginx 相关介绍(Nginx是什么?能干嘛?)
查看>>
Nginx 知识点一网打尽:动静分离、压缩、缓存、跨域、高可用、性能优化...
查看>>
nginx 禁止以ip形式访问服务器
查看>>
NGINX 端口负载均衡
查看>>
Nginx 结合 consul 实现动态负载均衡
查看>>
Nginx 负载均衡与权重配置解析
查看>>
Nginx 负载均衡详解
查看>>