3,158 views
2 votes
2 votes
if file size is large and is to be accessed randomly then which allocation strategy is best?

A. linked

B. indexed

c. contigous

1 Answer

Best answer
3 votes
3 votes

answer should be B

Contiguous:
All blocks of a file are stored contiguously. 
+ Faster access as all blocks are nearby.
+ Suitable for small sequentially accessed file
-Poor performance if file grows or shrinks.

Linked Allocation.
Each block stores pointer to next block
+No fragmentation.
+Suitable for large sequentially accessed file
-Random access is not possible, If one link is lost, cannot access subsequent blocks 
~ In File Allocation Table (FAT) all links are cached in a table for faster access.

Indexed Allocation
A single bock stores indexes of all blocks of a file.
+Suitable for large randomly accessed file
Eg: UNIX inode stores the first 12 or so data block pointers and then singly, doubly, and triply indirect pointers.

selected by

Related questions

0 votes
0 votes
1 answer
2
0 votes
0 votes
3 answers
3