9 9 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 $\text{F3, F4, F1, F5, F6, F2}$ $\text{F2, F6, F5, F1, F4, F3}$ $\text{F1, F2, F3, F4, F5, F6}$ Ordering is immaterial as all files are accessed with the same frequency. Databases isro2015 file-system + – Purple 10.5k views answer comment Share Follow Print See all 2 Comments 2 2 Comments reply Vineet Singh 1 commented Apr 3, 2018 reply Follow flag what is the meaning of all files are accessed with same frequency? 0 0 replyShare aniruddh kumar commented Nov 1, 2019 reply Follow flag it uses B Tree to insert node... 0 0 replyShare Please log in or register to add a comment.
15 15 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 Pooja Palod answered Oct 12, 2015 Pooja Palod comment Share Follow See all 3 Comments 3 3 Comments reply yankur9 commented Nov 22, 2017 reply Follow flag why ? how cost to access file will be minimum? 0 0 replyShare bhuv commented Dec 14, 2017 reply Follow flag If three files os size is like [1000, 30, 2] To access the file having size 2 in a "tape" which read sequentially like our old audio cassette we need to read "unnecessarily" 1000 and 30 file sized also. But if arrangement would be [2,30,1000] to read 2 bytes we just access it, no need to wait to skip over 1030 bytes to reach the required file. 6 6 replyShare mouli commented Aug 14, 2025 reply Follow flag Why This Makes SenseSince tapes (or sequential storage media) must be read from the start until the required file, placing smaller files first reduces the total cumulative “skipping” cost. For example, retrieving the smallest file F3 (50 records) doesn’t require traversing over much other data. If F2 (200) were first, you'd always read past a huge chunk before finding even the smallest file, increasing average access time per request 2 2 replyShare Please log in or register to add a comment.
0 0 votes Using optimal merge pattern Option A. Umang Raman answered Oct 12, 2015 Umang Raman comment Share Follow 0 reply Please log in or register to add a comment.
0 0 votes I think Option A Since each file is accessible with same frequency. sdpshaw answered Oct 12, 2015 sdpshaw comment Share Follow 0 reply Please log in or register to add a comment.
0 0 votes F1,F2,F3,F4,F5,F6 Hareesh Vajja answered Nov 3, 2015 Hareesh Vajja comment Share Follow 0 reply Please log in or register to add a comment.
0 0 votes Ans.A gkumar kumar answered Jan 26, 2016 • edited Jan 28, 2016 by gkumar kumar gkumar kumar comment Share Follow See 1 comment 1 1 comment reply Purple commented Jan 26, 2016 reply Follow flag answer is A. 0 0 replyShare Please log in or register to add a comment.
0 0 votes For optimization of storage we can arrange the files in ascending order,i.e.,option A Regina Phalange answered Apr 2, 2017 Regina Phalange comment Share Follow 0 reply Please log in or register to add a comment.