文件名称:stop
-
所属分类:
- 标签属性:
- 上传时间:2012-11-16
-
文件大小:2.84kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
由于停车场是一个狭窄通道,问题要求汽车“到达”或“离去”信息。由此很容易联想到数据结构中的堆栈模型,因此可首先设计一个堆栈,以堆栈来模拟停车场,又每个汽车的车牌号都不一样,这样一来可以根据车牌号准确找到汽车位置,所以堆栈里的数据元素我设计成汽车的车牌号。当停车场内某辆车要离开时,在他之后进入的车辆必须先退出车场为它让路,待该辆车开出大门外,其他车辆再按原次序进入停车场。这是一退一进的过程,而且让道的汽车必须保持原有的先后顺序,因此可再设计一个堆栈,以之来暂时存放为出站汽车暂时让道的汽车车牌号。当停车场满后,继续进来的汽车需要停放在停车场旁边的便道上等候,若停车场有汽车开走,则按排队的先后顺序依次进站,最先进入便道的汽车将会最先进入停车场,这完全是一个先进先出模型,因此可设计一个队列来模拟便道,队列中的数据元素仍然设计成汽车的车牌号。另外,停车场根据汽车在停车场内停放的总时长来收费的,在便道上的时间不计费,因此必须记录车辆进入停车场时的时间,车辆离开停车场时的时间不需要记录,当从终端输入时可直接使用。-Because the parking lot is a narrow channels, require car \"reach\" or \"away\" information. This is easy to associate the data structure stack model, it can first design a stack to stack to simulate the parking lot, and each car registration number is different, so can accurately find car according to the plates of the position, so the stack of data elements I designed to the plates of the car. When a car in the parking lot to leave, after his vehicles must first exit into information for way for him, for the car open gate, other vehicles again to the original order into the parking lot. This is a back into the process, and make cars must keep the original of the order, so to design a stack and to temporarily store for the car my way station for car images. When the parking lot after full, continue to come in car needs in the parking lot next to the park on the pavement waiting, if a battered car parking lot, then the order of line up in turn to stop, and the first into the pavement w
(系统自动生成,下载前可以参看下载内容)
下载文件列表
stop.cpp
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.