1.
Consider the following file containing Fixed-length records,
The file contains 10 records as follows:
RRN 0 1 2 3 4 5 6 7 8 9
Contents: A… B… C… D… E… F… G… H… I… J
Draw the contents of the AVAIL LIST and those of the data file after all of the following steps have been
completed:
- Record with RRN=2 has been deleted,
List head=2
RRN 0 1 2 3 4 5 6 7 8 9
Contents: A… B… *-1 D… E… F… G… H… I… J
- Record with RRN=8 has been deleted,
List head=8
RRN 0 1 2 3 4 5 6 7 8 9
Contents: A… B… *-1 D… E… F… G… H… *2 J
- Record with RRN=0 has been deleted and
List head=0
RRN 0 1 2 3 4 5 6 7 8 9
Contents: *8 B… *-1 D… E… F… G… H… *2 J
- Record K has been added
(All in this order)
List head=8
RRN 0 1 2 3 4 5 6 7 8 9
Contents: K B… *-1 D… E… F… G… H… *2 J
2. Consider the following file containing variable-length records and fields.
The file contains 4 records as follows
if FIRST-FIT placement strategy is used.
R1 R2 R3 R4 R5
Size 50 80 40 50 60
Address 0 50 130 170 220
Draw the contents of the AVAIL LIST and those of the data file after all of the following steps have been
completed:
Initial list head → -1
- Record R5 has been deleted
List Head→220
R1 R2 R3 R4 *-1 | 60
Size 50 80 40 50 60
Address 0 50 130 170 220
- Record R1 has been deleted,
List Head→0
*220 | 50 R2 R3 R4 *-1 | 60
Size 50 80 40 50 60
Address 0 50 130 170 220
- Record R3 has been deleted and
List Head→130
*220 | 50 R2 *0 | 40 R4 *-1 | 60
Size 50 80 40 50 60
Address 0 50 130 170 220
- Record R6 of size 70 has been added
List Head→130
*220 | 50 R2 *0 | 40 R4 *-1 | 60 R6
Size 50 80 40 50 60 70
Address 0 50 130 170 220 280
3..Consider a file containing variable-length records and fields.
The file contains 4 records: R1 of size 26, R2 of size 38, R3 of size 21 and R4 of size 31.
We use a list of available records (AVAIL LIST) for reclaiming space from deleted records.
Assume that the AVAIL LIST is initially empty.
R1 R2 R3 R4
Size 26 38 21 31
Address 0 26 64 85
Assume that a Worst-Fit strategy is used and later, the above file is modified in the following order:
a) Record R3 is deleted, b) Record R5 of size 25 is added,
c) Record R4 is deleted, d) Record R6 of size 17 is added.
What is the content of AVAIL LIST (in terms of the size of the blocks included in it) after these
modifications have been performed?
a) Record R3 is deleted, (blok1:21)
R1 R2 *R3 R4
Size 26 38 21 31
Address 0 26 64 85
b) Record R5 of size 25 is added, ( Added at the end)
R1 R2 *R3 R4 R5
Size 26 38 21 31 31
Address 0 26 64 85 116
c) Record R4 is deleted, ( block1: 31, Blok2: 21)
R1 R2 *R3 *R4 R5
Size 26 38 21 31 25
Address 0 26 64 85 116
d) Record R6 of size 17 is added.( added in place of R4, Blok1:21, Blok2: 14)
R1 R2 *R3 R6 R5
Size 26 38 21 17 14 25
Address 0 26 64 85 102 116