Thursday, October 18, 2012

Pairs of numbers whose sum is "S"


In a given sorted array of integers, print the pairs of numbers which give a sum "S" in O(N) time.

The problem like this can be solved with 2 pointers.

Solution:-

No comments:

Post a Comment

UA-36403895-1