File Organisation (Cambridge (CIE) A Level Computer Science): Revision Note
Exam code: 9618
What is file organisation?
Files store data permanently on secondary storage as a collection of records, where each record represents one item (a customer, a transaction, a product)
File organisation is the way those records are arranged within the file
The method chosen affects how quickly records can be searched, added, updated and deleted, so it is picked to suit the task
Choosing a method
There are three organisation methods you need: serial, sequential and random
The organisation you choose also decides which access methods are possible (see File Access)
File organisation methods
Serial file organisation
Records are stored one after the other, in the order they arrive (chronological order, no sorting)
New records are appended to the end of the file
Simple to implement, but slow to search because there is no order to exploit
Best for | Example |
|---|---|
Unsorted or temporary transaction files data logging files | Logging sensor readings as they arrive |
Sequential file organisation
Records are stored in sorted order, based on a key field
To update the file, a new version of the file has to be created (records cannot easily be inserted in place)
More efficient to search than serial, because a search can stop once the key is passed
Best for | Example |
|---|---|
Files read often but rarely updated | Payroll files, exam results ordered by candidate number |
Random (direct) file organisation
Records are stored in no particular order; there is no sequencing in where a record is placed
There is a relationship between the record's key and its location: a hashing algorithm is applied to the key to work out the address
Updates can be carried out directly, without rewriting the file
Best for | Example |
|---|---|
Fast, real-time access to individual records | Bank account lookup, live stock updates |
Summary
Method | How records are stored | Updating |
|---|---|---|
Serial | Order of arrival, appended to the end | Append to end |
Sequential | Sorted by key field | Create a new version of the file |
Random | Location set by a hashing algorithm on the key | Direct |
Examiner Tips and Tricks
For serial, both "records stored in the order they arrive" and "new records are appended to the end" are separate mark points. Give both.
Do not confuse organisation (how records are arranged) with access (how records are read). A question can ask about either, so keep the two ideas separate in your answer.
Unlock more, it's free!
Was this revision note helpful?
Build on this topic