Bỏ qua nội dung

Labs · 9618 A2 13.2

Serial and Sequential Files

Be the program that reads a file one record at a time. Know when to stop searching, and copy a sequential file to insert or delete a record.

7 levelsFree bench

In the exam

9618/31 May/June 2024 · Question 4 · 5 marks

(a) Describe the sequential method of file access. (b) Explain how the sequential method of file access is applied to files with serial organisation and to files with sequential organisation.

Points that gain marks

  • (a) Sequential access searches for records one after the other …
  • … from the physical start of the file until the record is found or the end of the file is reached.
  • (b) In serial files, records are stored in chronological order …
  • … so every record needs to be checked until the record is found, or all records have been checked.
  • In sequential files, records are stored in order of a key field, and it is the key field that is compared …
  • … every record is checked until the record is found, or the key field of the current record is greater than the key field of the target record.

In this lab: Levels 1–4: the serial file is read to the end; the sequential file stops at the first bigger key.

9618/31 October/November 2021 · Question 5 · 6 marks

(a) Compare sequential and serial methods of file organisation. (b) State the most suitable method of file access when a record is referenced by a unique address on a disk-type storage medium. (c) State the most suitable method of file access when a bank stores its data records in ascending order of account number.

Points that gain marks

  • (a) In both, records are stored one after the other, and need to be accessed one after the other.
  • Serial files are stored in chronological order; sequential files are stored in the order of the key field.
  • In serial files, new records are appended (added in the next available space) …
  • … in sequential files, new records are inserted in the correct position.
  • (b) Direct access.
  • (c) Sequential access.

In this lab: Level 5 inserts a record in its place; level 7 sorts these statements.

More real experiments

Đăng nhập hoặc tạo tài khoản

IGCSE, A-Level & AP