GATE CSE 2022Operating System › I/O, Disk Scheduling & File SystemsVerified
GATE CSE 2022 PYQ: Consider two files systems A \text{A} A and B \text{B} B , that use contiguous allocation and linked…
Answer
153
Approach
Compare insertion cost under contiguous and linked allocation. For contiguous allocation, insertion forces all following blocks to be shifted to preserve contiguity. For linked allocation, only pointers change, but reaching the insertion point requires sequential traversal. The new block data is already in memory, and file control blocks are in memory, so no extra metadata or allocation I/O is counted.
Contiguous allocation needs 50 block shifts (100 accesses) plus writing the new block (1), giving 101. Linked allocation needs 50 reads to reach the insertion point plus 2 writes to link the new block and update the previous block, giving 52. The required total is 153.
Reviewed by GateIQ Editorial Team: IIT & IISc Alumni.