Given an integer 'k' and an sorted array A (can consist of both +ve/-
ve nos),
output 2 integers from A such that a-b=k.
PS:
nlogn solution would be to check for the occurence of k-a[i] (using
bin search) when you
encounter a[i]. methods like hash consume space.

Is an O(n) solution with O(1) extraspace possible?

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to