Minimum number of disk I/O operations required


#1

Given a file of 100 blocks, what is the minimum number of disk I/O operation required to insert a block in the middle of the file if contiguous allocation is used (assume the block to be inserted is already in memory) ?

(i)2
(ii)52
(iii)101
(iv)151


#2

Option (iii) is correct.

50 read operation + 50 write operation + 1 write operation

Logic is we have to shift all the 50 elements right to make space for the new element to be inserted and then finally insert the new element.