- 7
- 0
- 约1.81万字
- 约 41页
- 2017-06-05 发布于河南
- 举报
数据结构的一道题(国外英文资料)
数据结构的一道题
Basic operation of the 8584 circular queue
Time limit: 1000MS memory limit: 1000K
Number of submissions: 3772:1884
Problem: programming language: unlimited
The Description
Create an empty loop queue and implement basic algorithms such as queue, team, return queue length, return team header element, and queues traversal. Please complete the following procedure.
# include malloc. H
# include stdio, h
1 # define OK
# define the ERROR 0
Typedef int the Status; / / Status is the type of function, whose value is the functions resulting Status code, such as OK
Typedef int QElemType;
# define MAXQSIZE 100 / / maximum queue length (for loop queues, the maximum queue length is 1)
Typedef struct
{
QElemType * base; / / initialize the dynamically allocated storage space
Int the front; / / head pointer, if the queue is not empty, points to the queue header element
Int rear; / / tail pointer, if the queue is not empty, point to the next location of the queue tail element
} SqQueue;
The Status InitQueue (SqQueue Q)
{
/ / construct an empty queue Q that has a predefined size of MAXQSIZE
/ / please complete the code
}
Status EnQueue (SqQueue Q, QElemType e)
{
/ / insert the new queue element for Q
/ / please complete the code
}
Status DeQueue (SqQueue Q, QElemType e)
{
/ / if the queue is not empty, remove the team header element of Q, return its value with e, and return OK. Otherwise it returns the ERROR
/ / please complete the code
}
Status GetHead (SqQueue Q, QElemType e)
{
/ / if the queue is not empty, return the header element with e, return OK, or return ERROR
/ / please complete the code
}
Int QueueLength SqQueue (Q)
{
/ / the number of elements that return Q
/ / please complete the code
}
The Status QueueTraverse SqQueue (Q)
{
/ / if the queue is not empty, the queue element is printed from the header to the queue, and it returns OK. Otherwise returns the ERROR.
Int I;
I = Q.f ront;
If ( The Queue is Empty! ) / / please fill in the blanks
The else {
Printf
您可能关注的文档
- 夜店常放的歌曲!很嗨(国外英文资料).doc
- 大学信息技巧演习6(国外英文资料).doc
- 大学英语四级写作高分通衢——《新(国外英文资料).doc
- 大卫 科波菲尔 简介(国外英文资料).doc
- 大学英语四级测验句子翻译常用技能(国外英文资料).doc
- 大别山新导游词(国外英文资料).doc
- 外企与国企八大差异(国外英文资料).doc
- 大家的日语(第二五课、第二六课)(国外英文资料).doc
- 大学毕业论文标准格式【txt版】(国外英文资料).doc
- 外贸英语词汇2(国外英文资料).doc
- 村镇建设统计报表制度.docx
- T_CEPPEA 5069—2025 电力工程三维电子文件归档与电子档案管理规范.docx
- T_CSHE 0012—2024 压缩空气储能电站工程概(估)算费用标准.docx
- T_CSEE 0044—2024 特高压钢管塔及钢管构架加工技术规程.docx
- T_CSEE 0466.6—2024 柔性低频交流输电系统高压电气设备 第6部分:低频交联聚乙烯绝缘海底电缆试验规范.docx
- T_CSEE 0466.31—2024 柔性低频交流输电系统高压电气设备 第3-1部分:低频电磁式电压互感器.docx
- T_CSEE 0467—2024 电能计量装置电磁骚扰自动监测 技术规范.docx
- T_CSEE 0475—2024 输电线路状态信息智能汇集终端 技术规范.docx
- T_CSEE 0480—2024 换流站阀冷控制保护系统测试装置技术要求.docx
- T_CSEE 0020—2024 架空输电线路山火分布图绘制技术导则.docx
最近下载
- VDGP201_2002-05-01_VolumendefizitevonGutkenausNichteisenmetallen(中文).doc VIP
- 部编版道德与法治一年级下册第2课《做事要仔细》精美课件.pptx VIP
- 《新污染物治理技术》-课件全套 第1--13章 新污染物简介--- 人工智能与新污染物控制.pdf VIP
- 提高学习效率的六大诀窍五大方法.docx
- 2025年江苏省盐城市中考地理试卷及答案.docx VIP
- 化工制图习题集答案(20201030132317).pdf VIP
- DLT5427-2022年火力发电厂初步设计内容深度规定.doc
- 2025微博娱乐白皮书.docx VIP
- DL-T5153-2024火力发电厂厂用电设计技术规程.pptx VIP
- 体育教学论第4章.ppt VIP
原创力文档

文档评论(0)