File organization methods: in which type of file is a record’s physical location determined by applying a hash (mathematical) function to a key value?

Difficulty: Easy

Correct Answer: a hashed file

Explanation:


Introduction / Context:
Different file organizations trade off access speed, maintenance cost, and storage overhead. Recognizing which design uses a mathematical transformation of keys directly into storage addresses is important for understanding performance characteristics and collision handling strategies.


Given Data / Assumptions:

  • The question focuses on how a record’s location is computed.
  • A mathematical formula (hash function) maps a key to a slot/bucket.
  • We compare with tree, indexed, and sequential organizations.


Concept / Approach:
A hashed file uses a hash function h(key) to compute a bucket address. It provides near-constant-time access for exact-key lookups, assuming a good hash and manageable load factor. Tree files (for example, B-trees) and indexed files rely on ordered structures and pointers; sequential files store records in key order and require scanning or binary search on sorted media.


Step-by-Step Solution:
Identify the keyword “mathematical formula” transforming key → location.Match to hashing: h(key) → bucket/page address.Select “a hashed file.”


Verification / Alternative check:
Hashed organizations use primary area plus overflow chains for collisions; indexed organizations maintain separate index structures instead of direct key-to-address mapping.


Why Other Options Are Wrong:

  • Tree file / indexed file: Use search paths or index pages, not direct hash computations to addresses.
  • Sequential file: Requires ordered traversal or search; not computed addressing.
  • None of the above: Incorrect because hashing matches exactly.


Common Pitfalls:
Assuming hashing is always faster: range queries perform poorly on hashed files because address computation destroys ordering. Also, poor hash functions lead to clustering and long overflow chains.


Final Answer:
a hashed file

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion