one of microsoft interview question....if anybody interested

in given array int num[10]={1,-5,6,7,9,9,20,25,31,45} it is a sorted
array.
    write a function void findsum(int [],int x)
int [] is array and x is number.
function should print all possible pair of elements in array that can
make a sum equal to x.
for example if value of x is 26
then function should print
        1,25
        25,1
       -5,31
        31,-5
Function should be implemented using O(N) or O(2N) approach try to
avoid using O(N 2) approach(Means avoid nested loop).


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/algogeeks
-~----------~----~----~----~------~----~------~--~---

Reply via email to