You are given a sorted array X of distinct integers {x1, x2, . . . , xn}, drawn from 1 to m, where m > n.
a) Give an O(log n) algorithm to find an integer from [1, m] that is not present in A and find the smallest such integer.
b) Explain why the algorithm runs in O(log n) time.
c) Explain why your algorithm is correct.
9 years ago
15
Answer(2)![blurred-text]()
![]()
![blurred-text]()
![]()
Purchase the answer to view it

NOT RATED
Purchase the answer to view it

NOT RATED
- GiveanO.docx
