Operating-Systems
October 5, 2023
ER-Model
October 5, 2023
Operating-Systems
October 5, 2023
ER-Model
October 5, 2023

Operating-Systems

Question 24
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 24 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.
Correct Answer: A
Question 24 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.
0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
error: Alert: Content selection is disabled!!