Question: Problem 5 [12 marks] Let n = 2 - 1 for some positive integer l. Suppose someone claims to hold an unsorted array A1..n) of
![Problem 5 [12 marks] Let n = 2 - 1 for](https://s3.amazonaws.com/si.experts.images/answers/2024/08/66d0bd0dacf9d_91766d0bd0da7a1f.jpg)
Problem 5 [12 marks] Let n = 2 - 1 for some positive integer l. Suppose someone claims to hold an unsorted array A1..n) of distinct (-bit strings; thus, exactly one l-bit string does not appear in A. Suppose further that the only way we can access A is by calling the function FetchBit(i, j), which returns the j-th bit of the string Ali in O(1) time. Describe an algorithm to find the missing string in A using only O(n) calls to FetchBit. In this problem you can build additional data structures if necessary (for instance, build an array or a list containing indices of elements in A). But you can access A using the function FetchBit() only
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
