xxxx18一60岁hd中国/日韩女同互慰一区二区/西西人体扒开双腿无遮挡/日韩欧美黄色一级片 - 色护士精品影院www

  • 大小: 1.63MB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發(fā)布日期: 2023-08-31
  • 語言: C/C++
  • 標(biāo)簽: 算法??

資源簡介

可以對給出的任意的磁盤請求序列、計(jì)算平均尋道長度;?? 要求可定制磁盤請求序列長度、磁頭起始位置、磁頭移動(dòng)方向。 測試:假設(shè)磁盤訪問序列:98,183,37,122,14,124,65,67;讀寫頭起始位置:53,方向:磁道增加的方向。

資源截圖

代碼片段和文件信息

#include?
#include?
using?namespace?std;

int?a;//當(dāng)前磁道號(hào)
int?direction;?//磁頭方向
int?num;?//輸入磁道總數(shù)

const?int?Maxqueue?=?200;??//定義隊(duì)列最大數(shù)
?
typedef?struct?node
{????????????????//磁道結(jié)構(gòu)體
int?value;
int?visted;
}cidao;

cidao?queue[Maxqueue];
void?shuru1()
{
cout<<“請依次磁道號(hào):“< for(int?i?=?0;i cin>>queue[i].value;
cout<<“輸入初始磁道號(hào):“;
cin>>a;
}
void?shuru2()
{
cout<<“請輸入需要的磁道總數(shù)“< cin>>num;
}
void?initial()
{
for(int?i?=?0;i {
queue[i].value?=?-1;
queue[i].visted?=?0;
}
}

void?sstf()
{
int?total?=?0;//總移動(dòng)的柱面數(shù)
int?p;
int?current;
for(int?i?=?0;i queue[i].visted?=?0;
current?=?a;
for(int?i?=?0;i {
p?=?0;
while(queue[p].visted!=0)
{
p++;
}
for(int?j?=?p;j {
if((queue[j].visted==0)&&(abs(current-queue[p].value)>abs(current-queue[j].value)))
{
p?=?j;
}
}
cout< total?+=?abs(queue[p].value-current);??//計(jì)算總柱面
queue[p].visted?=?1;
current?=?queue[p].value;
}
cout<}
void?scan()
{
int?total?=?0;
int?p;
int?current;
int?index?=?0;
cout<<“輸入方向:1或0“< cin>>direction;
cout< for(int?i?=?0;i queue[i].visted?=?0;
current?=?a;
int?temp?=?0;
for(int?i?=?0;i {
for(int?j?=?i;j {
if(queue[i].value>queue[j].value)
{
temp?=?queue[i].value;
queue[i].value?=?queue[j].value;
queue[j].value?=?temp;
}
}
}
for(int?i?=?0;i {
if(queue[i].value>=a)
{
index?=?i;
break;
}
}
cout< if(direction?==?1)
{
for(int?i?=?index;i {
cout< }
for(int?i?=index?-?1;i>=0;i--)//回轉(zhuǎn)
{
cout< }
}
else
{
for(int?i?=index?;i>=0;i--)//往外
{
cout< }
for(int?i?=?index;i {
cout< }
}
}


void?main()
{
//initial();
//shuru2();
//shuru1();
//sstf();

initial();
shuru2();
shuru1();
scan();
}

?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----

?????文件??????68608??2016-12-09?20:22??最短尋道時(shí)間優(yōu)先\Debug\最短尋道時(shí)間優(yōu)先.exe

?????文件?????555340??2016-12-09?20:22??最短尋道時(shí)間優(yōu)先\Debug\最短尋道時(shí)間優(yōu)先.ilk

?????文件?????822272??2016-12-09?20:22??最短尋道時(shí)間優(yōu)先\Debug\最短尋道時(shí)間優(yōu)先.pdb

?????文件????????558??2016-12-09?20:22??最短尋道時(shí)間優(yōu)先\最短尋道時(shí)間優(yōu)先\Debug\cl.command.1.tlog

?????文件??????11794??2016-12-09?20:22??最短尋道時(shí)間優(yōu)先\最短尋道時(shí)間優(yōu)先\Debug\CL.read.1.tlog

?????文件????????258??2016-12-09?20:22??最短尋道時(shí)間優(yōu)先\最短尋道時(shí)間優(yōu)先\Debug\CL.write.1.tlog

?????文件??????????2??2016-12-09?20:22??最短尋道時(shí)間優(yōu)先\最短尋道時(shí)間優(yōu)先\Debug\link-cvtres.read.1.tlog

?????文件??????????2??2016-12-09?20:22??最短尋道時(shí)間優(yōu)先\最短尋道時(shí)間優(yōu)先\Debug\link-cvtres.write.1.tlog

?????文件??????????2??2016-12-09?20:22??最短尋道時(shí)間優(yōu)先\最短尋道時(shí)間優(yōu)先\Debug\link-rc.read.1.tlog

?????文件??????????2??2016-12-09?20:22??最短尋道時(shí)間優(yōu)先\最短尋道時(shí)間優(yōu)先\Debug\link-rc.write.1.tlog

?????文件???????1018??2016-12-09?20:22??最短尋道時(shí)間優(yōu)先\最短尋道時(shí)間優(yōu)先\Debug\link.command.1.tlog

?????文件???????2428??2016-12-09?20:22??最短尋道時(shí)間優(yōu)先\最短尋道時(shí)間優(yōu)先\Debug\link.read.1.tlog

?????文件????????326??2016-12-09?20:22??最短尋道時(shí)間優(yōu)先\最短尋道時(shí)間優(yōu)先\Debug\link.write.1.tlog

?????文件?????156568??2016-12-09?20:22??最短尋道時(shí)間優(yōu)先\最短尋道時(shí)間優(yōu)先\Debug\main.obj

?????文件?????257024??2016-12-09?20:22??最短尋道時(shí)間優(yōu)先\最短尋道時(shí)間優(yōu)先\Debug\vc110.idb

?????文件?????339968??2016-12-09?20:22??最短尋道時(shí)間優(yōu)先\最短尋道時(shí)間優(yōu)先\Debug\vc110.pdb

?????文件????????553??2016-12-09?19:50??最短尋道時(shí)間優(yōu)先\最短尋道時(shí)間優(yōu)先\Debug\最短尋道時(shí)間優(yōu)先.Build.CppClean.log

?????文件?????????80??2016-12-09?20:22??最短尋道時(shí)間優(yōu)先\最短尋道時(shí)間優(yōu)先\Debug\最短尋道時(shí)間優(yōu)先.lastbuildstate

?????文件???????1745??2016-12-09?20:22??最短尋道時(shí)間優(yōu)先\最短尋道時(shí)間優(yōu)先\Debug\最短尋道時(shí)間優(yōu)先.log

?????文件???????2369??2016-12-09?20:22??最短尋道時(shí)間優(yōu)先\最短尋道時(shí)間優(yōu)先\main.cpp

?????文件???????4024??2016-12-08?19:29??最短尋道時(shí)間優(yōu)先\最短尋道時(shí)間優(yōu)先\最短尋道時(shí)間優(yōu)先.vcxproj

?????文件????????942??2016-12-08?19:29??最短尋道時(shí)間優(yōu)先\最短尋道時(shí)間優(yōu)先\最短尋道時(shí)間優(yōu)先.vcxproj.filters

?????文件????7143424??2016-12-09?20:25??最短尋道時(shí)間優(yōu)先\最短尋道時(shí)間優(yōu)先.sdf

?????文件????????939??2016-12-08?16:14??最短尋道時(shí)間優(yōu)先\最短尋道時(shí)間優(yōu)先.sln

????..A..H.?????21504??2016-12-09?20:25??最短尋道時(shí)間優(yōu)先\最短尋道時(shí)間優(yōu)先.v11.suo

?????目錄??????????0??2016-12-09?20:22??最短尋道時(shí)間優(yōu)先\最短尋道時(shí)間優(yōu)先\Debug

?????目錄??????????0??2016-12-09?19:50??最短尋道時(shí)間優(yōu)先\Debug

?????目錄??????????0??2016-12-08?19:29??最短尋道時(shí)間優(yōu)先\最短尋道時(shí)間優(yōu)先

?????目錄??????????0??2016-12-09?20:25??最短尋道時(shí)間優(yōu)先

-----------?---------??----------?-----??----

............此處省略2個(gè)文件信息

評論

共有 條評論