Question: In this assignment, we will apply the idea of divide and conquer algorithms (similar to binary search) to solve the below questions. Note: The running
In this assignment, we will apply the idea of divide and conquer algorithms (similar to binary search) to solve the below questions. Note: The running time of your solutions should be O(logn). solve it with c++
Question 2. Given a sorted array of n distinct numbers where the range of the numbers are between 0 to m and m>n (m is given by user). Find the smallest missing number. Example 1: input: a = [0, 1, 3, 6, 8, 9), m = 10 Output: 2 Example 2: input: a = (2, 5, 7, 11), m = 15 Output: 0 Example 3: input: a = [0, 1, 2, 3, 4], m = 8 Output: 5 Example 4: input: a = [12], m = 13 Output: 0
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
