what do u mean by* top k values?* can't the answer be 3,4,5,15,3+15 etc Regards, Akash Agrawal http://tech-queries.blogspot.com/
On Fri, Apr 8, 2011 at 7:22 PM, saurabh agrawal <[email protected]>wrote: > 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 > numbers can be: a(i), a(i)+a(j), a(i)+a(j)+a(l) for any i,j,l < k > > Ex: A[7] = {3,4,5,15,19,20,25} > output B[7] = {3,4,5,(3+4),(3+5),(4+5),(3+4+5)} > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
