Resources | Revision Questions | Computer Science
Click on a question to view the answer
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.
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.
Consider a scenario where a large text file contains log entries from a network server. Each log entry includes a timestamp, the source IP address, a message, and a status code. The system needs to be able to quickly retrieve all log entries for a specific IP address and to efficiently find all log entries within a given time range. Discuss, with reference to appropriate file organisation methods, which file organisation method would be most appropriate for this log file and explain your reasoning. Consider the advantages and disadvantages of different methods in this context.