April 1999
SW204: SOFTWARE AND FILES DESIGN

QUESTION 4

Total Marks: 20 Marks

Click here to access other questions

Click to access
SAMPLE STUDENT'S SOLUTIONS
for Question 4

 

Randomising algorithms are routines or programs that compute the address of a record on the basis of its key value.

 

(a) List the two objective of randomising algorithms.

 

[2]
(b) Self-addressing with key conversion is one approach to indirect addressing. Assume a file in which there are 10 records in each block, the number of the first block in the storage area in use is 1500, and the lowest key value in the set is 12000. Given a record with key number 13874, derive its location.

 

[4]
(c) Describe four ways of reducing the search time in a indexed sequential file.

 

[8]
(d) For each of the following, identify whether the system is in a consistent or an inconsistent state. If the system is in an inconsistent state, explain why this is so, and how the inconsistency may be resolved.
(i)  
Block No. 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
In Use 1 1 0 1 0 1 1 1 1 0 0 1 1 1 0 0
Free 0 0 0 0 1 0 0 0 0 1 1 0 0 0 1 1

 

[2]
(ii)  
Block No. 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
In Use 1 1 0 1 0 1 1 1 1 0 0 1 1 1 0 0
Free 0 0 1 0 2 0 0 0 0 1 1 0 0 0 1 1

 

[2]
(iii)  
Block No. 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
In Use 1 1 0 1 0 2 1 1 1 0 0 1 1 1 0 0
Free 0 0 1 0 1 0 0 0 0 1 1 0 0 0 1 1

 

[2]