Question: Task 4: Complete the following: 1. Write a pseudocode function R1(key, a, b, A, B, N) that takes non-negative integers key, a and b where

Task 4: Complete the following: 1. Write a pseudocode function R1(key, a, b, A, B, N) that takes non-negative integers key, a and b where a and b come from to the hashing function used to store indices in B; the arrays A and B of length N are also inputs: the function should return an index i where the value key is stored in array Aif found; it should return - 1 if the value cannot be found; otherwise it should return -2 if there was an error in the data storage, i.e. one of the values was altered unintentionally in at most one of the arrays. (8 marks] 2. Briefly explain how the method above could be adapted to allow for repeated integers in array A. [6 marks)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
