Assume a computer stores each file at consecutive locations on a hard disk. When
ID: 2900886 • Letter: A
Question
Assume a computer stores each file at consecutive locations on a hard disk. When a large file is erased and a smaller file is written in its place, only some of space is used. After many changes to the disk-that is, after a sequence of deletions and additions, mixed together-there may be many available storage locations, but these may be scattered across the disk in pieces too small to use. This sort of problem is called fragmentation.
Suppose a hard disk can store a total of 2^30 bytes of data and you need to store a file that is 2^12 bytes long. Suppose each file currently on the disk is 2^10 bytes long. a) What is the minimum number of files on the disk that will assure that your file will not fit? b) What is the maximum number of files of the disk that guarantee your file will fit? c) What is the smallest number of files that could be arranged on the disk in a way so that your file will not fit?
Explanation / Answer
a)
We have to find minimum n such that 2^30 - n*2^10 < 2^12
For limiting case, 2^30 - n*2^10 = 2^12
n = (2^30 - 2^12) / 2^10
n = 2^20 - 2^2
n = 2^20 - 4
So min. no. of files would be 2^20 -4 +1 = 2^20 - 3
b)
As found above, max. n = 2^20 - 4
c)
Same as part a.
= 2^20 - 3
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.