Re: [algogeeks] Google ques

2011-04-10 Thread saurabh agrawal
@aakash: you are given an array A of k values which contain int values in sorted (asec) order. Now u can understand it as if you have to create a new array which contains all elements , and sum of every two elements taken at a time and sum of all three elements taken at a time. eg if array is

Re: [algogeeks] Google ques

2011-04-09 Thread ArPiT BhAtNaGaR
WELL my answer is complexity is between n^2 to n SOLUTION LIES WITHIN THE SOLUTION Array AS: A= {3 4 5 15 19 20 25} first we have in B={ 3,4}now we have PTR1 @ 5andPTR2 always one less thab PTR1 means @ 4 now from B[0] upto the same element ie 4 add ptr2 and

[algogeeks] Google ques

2011-04-08 Thread saurabh agrawal
ou are given an array A of k values which contain int values in sorted (asec) order. Find top k values (asec) which can either be the number from the array A, or sum of any two numbers from A or sum of any three numbers from A. So, if A's values are represented as : a1,a2,...,ak , the possible