Question
8. [10 points] Given a sorted array A[1...n] and a value k, we want to return a pair of distinct indices such that the sum of elements at those indices equals k. That is, we want to return a pair of indices (i, j), where 1 ≤ i ≤ j≤n and A[i] + A[j] = k. (i) Design a O(n²) algorithm PAIRSUM(A[1...n], k) to solve the pro
Question image 1