Chapter 4: Problem 23
Suppose we minimize the average time to store \(n\) files of lengths \(l_{1}, l_{2}, \dots, l_{n}\) on a tape. If the probability of requesting file \(k\) is given by \(p_{k}\), the expected access time to load these \(n\) files in the order \(k_{1}, k_{2}, \ldots, k_{n}\) is given by the formula \(T_{\text {average}}=C \sum_{f=1}^{n}\left(p_{k_{f}} \sum_{i=1}^{f} l_{k_{i}}\right)\) The constant \(C\) represents parameters such as the speed of the drive and the recording density. a. In what order should a greedy approach store these files to guarantee minimum average access time? b. Write the algorithm that stores the files, analyze your algorithm, and show the results using order notation.
Short Answer
Step by step solution
Key Concepts
These are the key concepts you need to understand to accurately answer the question.