Question: Exercise 8 (20 points) We consider a sorted array of distinct integers indexed from 1 ton a) Find an algorithm, whose temporal complexity is O(lg(n))

Exercise 8 (20 points) We consider a sorted array of distinct integers indexed from 1 ton a) Find an algorithm, whose temporal complexity is O(lg(n)) in the worst case, and which finds an index 1 sisn, such that tab[i] = i, provided that such an index exist. b) Demonstrate the temporal complexity of your algorithm with the master theorem c) Explain (informally) why your algorithm is correct. d) Can we find such an efficient algorithm if the integers are not distinct? Why
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
