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

你可能感兴趣的文章
mysql社工库搭建教程_社工库的搭建思路与代码实现
查看>>
Warning: Can't perform a React state update on an unmounted component. This is a no-
查看>>
mysql笔记 (早前的,很乱)
查看>>
MySQL笔记:InnoDB的锁机制
查看>>
mysql第一天~mysql基础【主要是DDL、DML、DQL语句,以及重点掌握存存引擎、查询(模糊查询)】
查看>>
mysql第二天~mysql基础【查询排序、分页查询、多表查询、数据备份与恢复等】
查看>>
MySQL简介和安装
查看>>
MySQL简单查询
查看>>
MySQL管理利器 MySQL Utilities 安装
查看>>
MySQL篇(管理工具)
查看>>
mysql类型转换函数convert与cast的用法
查看>>
mysql系列一
查看>>
MySQL系列之数据类型(Date&Time)
查看>>
MySQL系列之数据类型(Date&Time)
查看>>
Mysql系列之锁机制
查看>>
Mysql系列九:使用zookeeper管理远程Mycat配置文件、Mycat监控、Mycat数据迁移(扩容)...
查看>>
MySql系列:[4200][1140]In aggregated query without GROUP BY, expression #2 of SELECT list contains nona
查看>>
Mysql索引
查看>>
mysql索引
查看>>
mysql索引
查看>>