Question: just answer part a. please use pseudo code and c++ 4. Algorithm Design (a) (10 points) For an array A of size N and A[1]
4. Algorithm Design (a) (10 points) For an array A of size N and A[1] > A[N], devise an efficient algorithm to find a pair of elements A[i] and A[i+1] such that A[i] > A[i+1]. Can you always find such adjacent pair and why? Justify your conclusion. (b) (10 points) From an array of N (N>2) elements develop an efficient algorithm to find 2 elements i and j such that A[i]+A[]=2021. Describe your time complexity and justify
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
