86,578 views
The head of a moving head disk with $100$ tracks numbered $0$ to $99$ is currently serving a request at track $55$. If the queue of requests kept in FIFO order is $$10, 70, 75, 23, 65$$
which of the two disk scheduling algorithms FCFS (First Come First Served) and SSTF (Shortest Seek Time First) will require less head movement? Find the head movement for each of the algorithms.

It is given that input is in queue. SSTF will require all at once.
If the queue of requests kept in FIFO order -> then how can SSTF know 65 is closer to 55? If we get elements one by one from the queue, then will SSTF be different from FCFS?

FCFS : 55→10→70→75→23→65 ⇒ 45+60+5+52+42=204.

55→10→70→75→23→65 ⇒ 45 + 40 + 5 + 48 + 42 = 190.

SSTF : 55→65→70→75→23→10⇒10+5+5+52+13=85

55→65→70→75→1023⇒10+5+5+35+13= 68

I think there is some problem with above answer.

Can anyone verify this ?

Piyush In SSTF, the ordering of the queue doesn’t matter. It will always pick the least seek time.

FCFS : $55 \rightarrow10 \rightarrow70 \rightarrow 75 \rightarrow 23 \rightarrow 65 \Rightarrow 45+60+5+52+42=204.$

SSTF : $55 \rightarrow 65 \rightarrow 70 \rightarrow 75 \rightarrow 23 \rightarrow 10 \Rightarrow 10+5+5+52+13=85$

Hence, SSTF.

by

If the queue of requests kept in FIFO order -> then how can SSTF know 65 is closer to 55? If we get elements one by one from the queue, then will SSTF be different from FCFS?
edited

@Arjun @Sachin Mittal 1 Sir should’nt the answer for FCFS and SSTF be same because we are using a queue so for SSTF how can we know which next cylinder will give minimum number of head movements ??