in Operating System
3,136 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
in Operating System
3.1k views

4 Comments

A dont support random access.

B and c support
0
0
yes, but which would be best
0
0
I think for a large file size contiguous will be best.

Because index has to maintain large number of pointers which is sometimes not possible.
1
1

for large size, it might be case that space is available but not available in countiguous manner, so indexed allocation is best suited for above case.

1
1

1 Answer

3 votes
3 votes
Best answer

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
by

4 Comments

Question starts with "file size is large"....
0
0
what about pointer overhead???
0
0

- continuous allocation is not good for large files 

- linked alocation is not good for random access.

So indexing is the best method  to satisfy both condition large file size and random access even though overhead of pointer is present 

0
0

Related questions