Which statement describes a sequential file?
An exam board stores candidates' results in a file. The records are held in ascending order of CandidateNumber.
Which statement about this file is correct?
A It is a serial file, so its records can only be read in the order they were added.
B It is a sequential file, and a new record is added by appending it to the end of the file.
C It is a sequential file, and a record can be found by reading from the start of the file until the key is found or passed.
D It is a random file, so each record's position is calculated from its key by a hashing algorithm.
[1]
- 1
Identify the organisation. Records stored in order of a key field form a sequential file, which rules out A (serial: order of arrival) and D (random: position from a hash).
- 2
Check B and C. Appending a new record to the end would break the key order, so B is wrong. Reading from the start until the key is found, or until a larger key shows it is not there, is sequential access to a sequential file. Answer C (1).
Answer
C
Examiner tip
Examiner tip: "key order" is the clue for sequential; "order of arrival" or "chronological" is the clue for serial. Mark schemes do not accept chronological order as a description of a sequential file.
Common mistake: choosing B. Only a serial file can have new records simply appended; a sequential file has to keep its key order.