train
K. 

所属分类:VC书籍
开发工具:Visual C++
文件大小:2KB
下载次数:3
上传日期:2011-06-13 15:17:16
上 传 者zhengzhi163
说明:  一列货运列车共有n节车厢,每节车厢将停放在不同的车站。假定n个车站的编号分别为1~n,即货运列车按照第n站至第1站的次序经过这些车站。为了便于从列车上卸掉相应的车厢,车厢的编号应与车站的编号相同,这样,在每个车站只要卸掉最后一节车厢。所以,给定任意次序的车厢,必须重新排列它们。 车厢的重排工作可以通过转轨站完成。在转轨站中有一个入轨、一个出轨和k个缓冲轨,缓冲轨位于入轨和出轨之间。假定缓冲轨按先进先出的方式运作,设计算法解决火车车厢重排问题。
(A total of n freight train cars, each car will be parked at different stations. Assume that the number of stations n are 1 ~ n, n accordance with the freight train station to the order of 1 station after the station. Remove from the train in order to facilitate the appropriate compartment, the number of cars and station number should be the same, so that at each station as long as relieved last carriage. Therefore, given any order of the cars, to rearrange them. Rearrangement of cars can be done through the transition station. There is a transition station in orbit, a rail derailment and k-buffer, the buffer between the rail in the orbit and the derailment. FIFO buffer is assumed by way of rail operations, the design algorithm to solve the problem rearrangement of railroad cars. )

文件列表:
火车问题.cpp (4957, 2011-06-06)

近期下载者

相关文件


收藏者