Prepare for the A Level Computer Science OCR Exam with engaging quizzes, detailed explanations, and effective study tips. Maximize your readiness and boost your confidence for exam day!

Practice this question and more.


What is a key feature of a Hash Table?

  1. It always sorts data in ascending order

  2. It uses a Hash Function to map keys to data

  3. It is limited by the size of the data set

  4. It requires sequential searching

The correct answer is: It uses a Hash Function to map keys to data

The correct answer highlights that a key feature of a hash table is its use of a hash function to map keys to data. Hash tables use this function to convert a given key into a hash code, which determines the index at which the data associated with that key will be stored. This enables efficient data retrieval, as it allows for average-case constant time complexity, O(1), for both insertions and search operations, assuming there are minimal collisions. In contrast, the other options do not accurately represent the fundamental characteristics of hash tables. Sorting data in ascending order is unrelated to how hash tables function, as they are primarily concerned with fast data access rather than organization. Additionally, while hash tables do have a capacity limit based on their implementation, this is not a defining feature of their structure. Lastly, requiring sequential searching contradicts the purpose of a hash table, which is to provide direct access to stored data through a calculated index rather than through a sequential search.