edited by
7,919 views
7 votes
7 votes

Six files $\text{F1, F2, F3, F4, F5}$ and $\text{F6}$ have $100, 200, 50, 80, 120, 150$ records respectively. In what order should they be stored so as to optimize act. Assume each file is accessed with the same frequency

  1. $\text{F3, F4, F1, F5, F6, F2}$
  2. $\text{F2, F6, F5, F1, F4, F3}$
  3. $\text{F1, F2, F3, F4, F5, F6}$
  4. Ordering is immaterial as all files are accessed with the same frequency.
edited by

7 Answers

14 votes
14 votes
This is basically optimal storage on tapes problem.Greedy apprach is used to solve this problem.The files are to be stored sequentially  on tape.To read a particular file we need to start from beginning of tape..here goal is to find such order of storage that cost to access file is minimum..in order to achieve the files are stored in increasing order of length

So in above eg files will be stored in order F3 F4 F1 F5 F6 F2
0 votes
0 votes
I think Option A

Since each file is accessible with same frequency.
Answer:

Related questions

7 votes
7 votes
3 answers
1
go_editor asked Jun 19, 2016
3,768 views
If a node has $K$ children in $B$ tree, then the node contains exactly _____ keys.$K^2$$K-1$$K+1$$\sqrt{K}$
8 votes
8 votes
2 answers
4