课程设计:停车场c语言版本的数据结构课程设计,要求用栈模拟停车场,用队列模拟便道,实现停车场的收费管理系统停车场停满车后车会停在便道上面下面附上源码,vc:(下编译#include//#include//malloc#includetop=—1;}/*push入站函数*/intpush(SqStackCar*s,CarNodex)//数据元素x入指针s所指的栈{if(s-〉top==MaxSize-1)return(0);//如果栈满,返回0else{s-〉stack[++s—>top]=x;//栈不满,到达车辆入栈return(1);}}/*栈顶元素出栈*/CarNodepop(SqStackCar*s){CarNodex;if(s—>top〈0){x
num=0;x
arrtime
hour=0;x
arrtime
minute=0;return(x);//如果栈空,返回空值}else{s—>top-—;return(s—〉stack[s-〉top+1]);//栈不空,返回栈顶元素}}/*初始化队列*/voidInitLinkQueue(LinkQueueCar*q){q—〉front=(QueueNode*)malloc(sizeof(QueueNode));//产生一个新结点,作头结点if(q-〉front
=NULL){q->rear=q->front;q-〉front-〉next=NULL;q—〉front—〉num=0;//头结点的num保存队列中数据元素的个数}}/*数据入队列*/voidEnLinkQueue(LinkQueueCar*q,intx){QueueNode*p;p=(QueueNode*)malloc(sizeof(QueueNode));//产生一个新结点p->num=x;p—>next=NULL;q-〉rear—〉next=p;//新结点