Wednesday, May 16, 2012

Design an algorithm to find all pairs of integers within an array which sum to a specified value?

Design an algorithm to find all pairs of integers within an array which sum to a specified value ?



It was not an assignment question. I had tried this problem using Hash table to store entry for sum of array elements but it is not the efficient solution and so want to know what are thoughts of other stackoverflow readers on it.



Thanks.





No comments:

Post a Comment