Re: midterm for 94.404 at UMass Lowell



TheGist wrote:
Consider a set S of n>=2 distinct numbers given in unsorted order.
c) In O(n) time, determine x,y in S such that x+y=Z, where Z is
given or determine that no two such numbers exist.

Ok, you got me. How do you solve this one in O(n) time?
.