File-storage-access-method

Question 1
Consider two files systems A and B , that use contiguous allocation and linked allocation, respectively. A file of size 100 blocks is already stored in A and also in B. Now, consider inserting a new block in the middle of the file (between 50 th and 51 st block), whose data is already available in the memory. Assume that there are enough free blocks at the end of the file and that the file control blocks are already in memory. Let the number of disk accesses required to insert a block in the middle of the file in A and B are n A and n B , respectively, then the value of n A + n B is_________.
A
102
Question 1 Explanation: 
Assume that there are enough free blocks at the end of the file and that the file control blocks are already in memory.
For linked allocation we have to trace the first 51 blocks, which requires 51 disk accesses. Similarly for contiguous allocation we have to move the block number 50-100 after insertion of a new block, which takes 51 accesses. Hence, the answer is 51+51 = 102.
There is 1 question to complete.

Access quiz wise question and answers by becoming as a solutions adda PRO SUBSCRIBER with Ad-Free content

Register Now

If you have registered and made your payment please contact solutionsadda.in@gmail.com to get access