GATEverse
← GATE CSE 1994

Q25

NATMarks unknown

An array AA contains nn integers in non-decreasing order, A[1]≤A[2]≤⋯≤A[n]A[1] \leq A[2] \leq \cdots \leq A[n]. Describe, using Pascal like pseudo code, a linear time algorithm to find i,j,i, j, such that A[i]+A[j]=aA[i]+A[j]=a given integer MM, if such i,ji, j exist.

Sign in to save attempts.

Loading…