• edited by
17,002 views
40 40 votes

A disk has $200$ tracks (numbered $0$ through $199$). At a given time, it was servicing the request of reading data from track $120$, and at the previous request, service was for track $90$. The pending requests (in order of their arrival) are for track numbers.

$30 \ 70 \ 115 \ 130 \ 110 \ 80 \ 20 \ 25.$

How many times will the head change its direction for the disk scheduling policies SSTF(Shortest Seek Time First) and FCFS (First Come First Serve)?

  1. $2$ and $3$
  2. $3$ and $3$
  3. $3$ and $4$
  4. $4$ and $4$

4 Answers

Best answer
54 54 votes

Answer is (C)

SSTF: $(90) \ 120 \ 115 \ 110 \ 130 \ 80 \ 70 \ 30 \ 25 \ 20$

Direction changes at $120,110,130$

FCFS: $(90) \ 120 \ 30 \ 70 \ 115 \ 130 \ 110 \ 80 \ 20 \ 25$

direction changes at $120,30,130,20$

• edited by
7 7 votes
Here it is mentioned in the question that the disk was servicing request from track 120 and previously it has serviced track 90 so
from 90 to 120 it must move in one direction (lets consider this direction -->)  then from 120 it must read 115(SSTF) which is in (<---) direction.
So the answer is C.
1 1 vote
According to Shortest Seek Time First:
90-> 120-> 115-> 110-> 130-> 80-> 70-> 30-> 25-> 20
Change of direction(Total 3); 120->15; 110->130; 130->80
According to First Come First Serve:
90-> 120-> 30-> 70-> 115-> 130-> 110-> 80-> 20-> 25
Change of direction(Total 4); 120->30; 30->70; 130->110;20->25
Answer:
Position:
Show:

Related questions

45 45 votes
7 answers 7 answers
16.1k
16.1k views
Ishrat Jahan asked Nov 2, 2014
16,122 views
In a particular Unix OS, each data block is of size $1024$ bytes, each node has $10$ direct data block addresses and three additional addresses: one for single indirect b...
37 37 votes
1 answers 1 answer
17.0k
17.0k views
Ishrat Jahan asked Nov 2, 2014
17,015 views
In a virtual memory system, size of the virtual address is $32$-bit, size of the physical address is $30$-bit, page size is $4$ Kbyte and size of each page table entry is...
35 35 votes
7 answers 7 answers
12.0k
12.0k views
Ishrat Jahan asked Nov 2, 2014
12,031 views
The semaphore variables full, empty and mutex are initialized to $0$, $n$ and $1$, respectively. Process P1 repeatedly adds one item at a time to a buffer of size $n$, an...
78 78 votes
10 answers 10 answers
26.8k
26.8k views
Ishrat Jahan asked Nov 2, 2014
26,766 views
In a certain operating system, deadlock prevention is attempted using the following scheme. Each process is assigned a unique timestamp, and is restarted with the same ti...