全文预览

数据结构停车场管理系统

上传者:相惜 |  格式:doc  |  页数:14 |  大小:0KB

文档介绍
己这样一个即将步入社会的人来说,需要学习的东西很多,他们就是最好的老师,正所谓“三人行,必有我师”,我们可以向他们学习很多知识、道理。在此,我应当感谢老师的指导与帮助以及学院提供此次千载难逢的实训机会。附录#include<stdio.h>#include<stdlib.h>#include<string.h>#include<math.h>#definesize1//停车场位置数//模拟停车场的堆栈的性质;typedefstructzanlind{intnumber;//汽车车号floatar_time;//汽车到达时间}zanInode;typedefstruct{zanInode*base;//停车场的堆栈底zanInode*top;//停车场的堆栈顶intstacksize_curren;}stackhead;//堆栈的基本操作;voidinitstack(stackhead&L)//构造一个空栈L{L.base=(zanInode*)malloc(size*sizeof(zanlind));if(!L.base)exit(0);//存储分配失败L.top=L.base;L.stacksize_curren=0;}voidpush(stackhead&L,zanInodee)//插入元素e为新的栈顶元素{*L.top++=e;L.stacksize_curren++;}voidpop(stackhead&L,zanInode&e)//若栈不为空,删除L的栈顶元素,用e返回其值{if(L.top==L.base){printf("停车场为空!!");return;}e=*--L.top;L.stacksize_curren--;}//模拟便道的队列的性质;typedefstructduilie{intnumber;//汽车车号floatar_time;//汽车到达时间

收藏

分享

举报
下载此文档