Multiple choiceQuestion 1 · Recall
Loading…
By the end you can distinguish between serial, sequential, and random file organisation, choose the appropriate organisation and access method for a given problem, and describe and use hashing algorithms to calculate record addresses in random files.
File organisation determines how records are physically stored on the storage medium. The choice affects access speed, storage efficiency, and ease of maintenance.
| Organisation | Description | Best for |
|---|---|---|
| Serial | Records stored in order of arrival (no key order). New records appended at end. | Log files, audit trails, temporary data |
| Sequential | Records stored in sorted order by a key field. | Master files processed in batch (e.g., payroll) |
| Random (Direct) | Records stored at addresses calculated from the key (hashing). Direct access by key. | Real-time systems, databases, indexes |
Example: A transaction log where each entry is appended with a timestamp.
Example: A customer master file sorted by CustomerID, processed monthly for statements.
Example: A student record system where StudentID hashes to a disk address for instant lookup.
Sequential access — read records one after another from the beginning.
Direct (random) access — jump straight to a specific record by address.
Choosing access method:
A hash function maps a key (e.g., StudentID) to a storage address (block/record number).
Desirable properties:
Common hash functions:
address = key MOD tableSize
address = floor(tableSize * frac(key * A)) where 0 < A < 1Example (division method):
Collision resolution:
Worked example: Choosing file organisation and hashing
A school needs to store 5000 student records. Each record has StudentID (key), Name, DOB, Form. The system must support: