An indexed (indexed-sequential) file offers the random-access capability of which file type and the access method characteristics of which other type?
-
ASequential file (sequential access method)
-
BIndexed file (index-only access method)
-
CDirect access file (random access capability)
-
DRandom access file (random plus hashed)
-
ETape file (block streaming)
Answer
Correct Answer: Sequential file (sequential access method)
Explanation
Introduction / Context:Classical file organizations balance ease of sequential processing with the need to locate specific records quickly. Indexed-sequential files (often called ISAM-style) combine two desirable properties: direct/random access via an index and efficient sequential processing over a key order.
Given Data / Assumptions:
- Records are stored in key order with an accompanying index.
- Users may need both sequential reports and fast point lookups/updates.
- Storage is on disk, allowing non-linear access.
Concept / Approach:The index (primary plus possibly secondary) enables random access similar to a direct (random) file. Once positioned, the organization still supports efficient sequential scans—much like a sequential file—because data blocks are ordered by key. Hence, an indexed file offers the facility of a random file and the access method of a sequential file.
Step-by-Step Solution:
1) Map 'facility of a random file' to direct access using an index. 2) Map 'access method of' to sequential traversal in key order. 3) Conclude the hybrid nature: random positioning + sequential processing.Verification / Alternative check:Consider typical operations: monthly statements (sequential pass) and customer inquiry by account number (random access). Indexed-sequential supports both without reorganization.
Why Other Options Are Wrong:
Saying 'indexed file provides index-only access' ignores sequential traversal. Direct/random file lacks built-in ordered sequential scanning benefits. Random access plus hashed does not ensure ordered sequential passes. Tape/block streaming implies linear scans without random positioning.Common Pitfalls:Confusing indexed-sequential with pure hashed files; hashing optimizes equality lookups but undermines ordered sequential reporting.
Final Answer:Sequential file (sequential access method).