Question: 5. (15 points) Suppose that n files having lengths Li,L2, , Ln are stored on a tape. If the files are stored in the order

5. (15 points) Suppose that n files having lengths Li,L2, , Ln are stored on a tape. If the files are stored in the order of 11,12, ,'m then the time to retrieve file k sTk-: )| Lij. The average retrieval time is defined as ! . Design a greedy algorithm for determining the order of the n files on a tape so as to minimize the average retrieval time. Show that your algorithm is optimal by stating and proving the greedy choice property and the optimal substructure property
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
