Question: 4. (30 points+10 points extra credit) You are given a sorted array A C that consists of n integer elements. You are also given an

4. (30 points+10 points extra credit) You are given a sorted array A C that consists of n integer elements. You are also given an integer z. Design an algorithm to determine whether or not there are two elements in AC] whose sum is exactly z. What is the time complexity of your algorithm in terms of 0) notation? Extra credit: You will receive 10 extra points if your algorithm can do this in O (n) time
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
