File organization concept check: which technique derives the storage address of a record directly from its record key?
-
Acomma
-
Bhashing
-
Cvariable
-
Dfield
-
ENone of the above
Answer
Correct Answer: hashing
Explanation
Introduction / Context:In file organization and database indexing, fast direct access to individual records is essential. One classical approach maps a record key to a storage address using a deterministic function, enabling constant-time average retrieval without scanning the entire file. The term for this technique is a staple in systems courses and interviews alike.
Given Data / Assumptions:
- We have a record key (e.g., account number) and need an address quickly.
- The method should compute the address rather than search sequentially.
- Collisions can occur and are handled by standard strategies.
Concept / Approach:Hashing computes address = hash_function(key). Good hash functions distribute keys uniformly to minimize collisions. Collision resolution can use chaining, open addressing, or double hashing. While databases often use B-trees for range queries, hashing excels in equality lookups where the exact key is known and rapid direct access is desired.
Step-by-Step Solution:
Identify the requirement: derive address from key without searching. Recall the concept: hashing maps keys to addresses via a function. Note collision handling as part of practical implementations. Select “hashing.”Verification / Alternative check:Operating systems and database textbooks define hashing precisely as address computation from keys, confirming the answer.
Why Other Options Are Wrong:
- Comma / variable / field: not address-derivation techniques; they are unrelated terms in this context.
- None: incorrect because hashing is the well-known technique.
Common Pitfalls:Confusing hashing with indexing trees; hash-based access is optimal for exact-match retrieval, not range scans.
Final Answer:hashing