Tuesday, June 15, 2010

Numbers in a array..

Problem : You have a array of random numbers and you are given a number k. Find the 2 elements in the array which sum up to k.

e.g: If my array is {2,5,3,1,8,7,5,4} and k=6.Then 2 numbers that sum up to 6 are 5 and 1.

well, of course the complexity of alogrithm matters.. !!

No comments: