Suppose there are six files F1, F2, F3, F4, F5, F6 with corresponding sizes 150 KB, 225 KB, 75 KB, 60…
On a sequential device each file can be reached only after passing the files stored before it, so the mean access time is lowest when the shortest files come first, as in…
Choose your answer
Suppose there are six files F1, F2, F3, F4, F5, F6 with corresponding sizes 150 KB, 225 KB, 75 KB, 60 KB, 275 KB and 65 KB respectively. The files are to be stored on a sequential device in such a way that optimizes access time. In what order should the files be stored ?
Answer and explanation
Correct answer B
On a sequential device each file can be reached only after passing the files stored before it, so the mean access time is lowest when the shortest files come first, as in shortest-job-first scheduling. Sorting by size gives 60, 65, 75, 150, 225 and 275 KB, that is F4, F6, F3, F1, F2, F5. Storing the files largest first does the opposite and gives the highest average access time.
Practice for these exams
-
UGC NET Computer Science and Applications