Description: Compartments use the queue structure to achieve the rearrangement problem. Rearrangement inside the following: a freight train and rode a total of n cars, each car has its own number, number range from 1 ~ n. The cars in any order given by the transition points will be re-arranged in order inside number 1 ~ n. Transition rail stations a total of k-buffer, the buffer between the rail in the orbit and the derailment. Initially, rail cars into the buffer from the orbit, after the rearrangement of the buffer track, press 1 ~ n the order into the derailment. Rail in accordance with the FIFO buffer mode, write an algorithm for arbitrary rearrangement of the order of the cars, the output of each track in the buffer compartment number.
To Search:
File list (Check if you may need any files):
09210448夏昕昕实验二栈和队列\Debug\t1.exe
............................\.....\t1.ilk
............................\.....\t1.obj
............................\.....\t1.pch
............................\.....\t1.pdb
............................\.....\vc60.idb
............................\.....\vc60.pdb
............................\Debug
............................\t1.cpp
............................\t1.dsp
............................\t1.dsw
............................\t1.ncb
............................\t1.opt
............................\t1.plg
............................\实验报告.doc
09210448夏昕昕实验二栈和队列