Computer Science – 13.2 File organisation and access | e-Consult
13.2 File organisation and access (1 questions)
Login to see all questions.
Click on a question to view the answer
Sequential File Organisation:
- Advantages: Simple to implement, efficient for sequential access (e.g., reading or writing the entire file). Good for applications where data is accessed in a predictable order.
- Disadvantages: Slow for random access. To find a specific record, the entire file must be read sequentially until the desired record is located. Inefficient for searching based on specific criteria (e.g., finding all customers who made a purchase in a particular month).
- Suitability: Suitable for applications where data is primarily accessed sequentially, such as generating reports that require processing the entire dataset. Also suitable when the dataset is relatively small and random access is infrequent.
Indexed Sequential File Organisation:
- Advantages: Combines the advantages of sequential and indexed file organisation. Efficient for both sequential and indexed access. An index is created (e.g., a B-tree) that maps search keys to the locations of records in the file.
- Disadvantages: More complex to implement than sequential file organisation. The index requires additional storage space. Maintaining the index requires overhead when data is updated (e.g., inserting or deleting records).
- Suitability: Suitable for applications where both sequential and indexed access are required. Ideal for databases where specific records need to be accessed frequently, but the data is primarily stored in a sequential order. The customer database described in the question is a good example. The index allows for quick retrieval of customer records based on various criteria (e.g., name, address, purchase history).
Comparison Table:
| Feature | Sequential | Indexed Sequential |
| Access Method | Sequential | Sequential & Indexed |
| Search Speed | Slow | Fast |
| Storage Efficiency | High | Lower (due to index) |
| Complexity | Low | High |