13.2 File organisation and access (3)

Resources | Revision Questions | Computer Science

Login to see all questions

Click on a question to view the answer

1.

Question 1

Explain the concept of a hash function and its importance in data structures like hash tables. Discuss the potential problem of collisions and outline two different collision resolution techniques. For each technique, briefly describe its advantages and disadvantages.

2.

Question 3

Compare and contrast the use of modular arithmetic in hash functions. Explain how the choice of the modulus value affects the distribution of hash values. Discuss the concept of a universal hash function and its benefits in avoiding worst-case collision scenarios. Provide a brief example of a universal hash function.

3.

Question 2

Consider a hash function that maps strings to integers. Describe the properties of a good hash function. Explain how the load factor of a hash table affects its performance and discuss strategies for managing the load factor. Provide an example of a simple hash function and discuss its potential weaknesses.