某列车调度站的铁道联接结构如图所示。
其中,A为入口,B为出口,S为中转盲端。所有铁道均为单轨单向式:列车行驶的方向只能是从A到S,再从S到B;也可以不在S中驻留,直接从A驶向B;另外,不允许超车。因为车厢可在S中驻留,所以它们从B端驶出的次序,可能与从A端驶入的次序不同。不过S的容量有限,同时驻留的车厢不得超过m节。
设某列车由编号依次为{a1, a2, ..., an}的n节车厢组成。调度员希望知道,按照以上交通规则,这些车厢能否以{1, 2, ..., n}的次序,重新排列后从B端驶出。
In this station, A is the entrance for each train and B is the exit. S is the transfer end. All single tracks are one-way, which means that the train can enter the station from A to S, and pull out from S to B. Note that the overtaking is not allowed. Because the compartments can reside in S, the order that they pull out at B may differ from that they enter at A. However, because of the limited capacity of S, no more that m compartments can reside at S simultaneously.
Assume that a train consist of n compartments labeled {1, 2, , n}. A dispatcher wants to know whether these compartments can pull out at B in the order of {a1, a2, , an} (a sequence). If can, in what order he should operate it? (2019-04-21, Visual C++, 1106KB, 下载1次)
某列车调度站的铁道联接结构如图所示。其中,A为入口,B为出口,S为中转盲端。所有铁道均为单轨单向式:列车行驶的方向只能是从A到S,再从S到B;也可以不在S中驻留,直接从A驶向B;另外,不允许超车。因为车厢可在S中驻留,所以它们从B端驶出的次序,可能与从A端驶入的次序不同。不过S的容量有限,同时驻留的车厢不得超过m节。设某列车由编号依次为{a1, a2, ..., an}的n节车厢组成。调度员希望知道,按照以上交通规则,这些车厢能否以{1, 2, ..., n}的次序,重新排列后从B端驶出。
In this station A is the entrance for each train and B is the exit S is the transfer end. All single tracks are one-way which means that the train can enter the station from A to S and pull out from S to B Note that the overtaking is not allowed Because the compartments can reside in S the order that they pull out at B may differ from that they enter at A However because of the limited capacity of S no more that m compartments can reside at S simultaneously Assume that a train consist of n compartments labeled 1 2 n A dispatcher wants to know whether these compartments can pull out at B in the order of a1 a2 an a sequence If can in what order he should operate it (2019-04-21, Visual C++, 1106KB, 下载0次)
模拟动态分区存储管理方式的主存分配与回收
(1)确定主存空间分配表(空闲分区,已分配分区);
(2)采用一种分配方法(BF,WF或FF等)完成主存空间分配和回收;
(3)编写主函数对所有工作进行测试。
Simulate dynamic partition management for main memory storage allocation and recovery (1) determine the main memory space allocation table (free partitions have been allocated partition) (2) using a distribution method (BF, WF, or FF, etc.) to complete main memory space allocation and recycling (3) to prepare the main function of all the work to be tested. (2009-11-08, Visual C++, 3KB, 下载18次)