Right, in the worst case, complexity with be O(2^N). So what are the possible optimizations here? Would building pre-computed data structures with intermediate sum values help in finding such pairs in less complexity? I think then we can apply dynamic programming to find such pairs.
On Mon, Jun 20, 2011 at 12:09 PM, oppilas . <[email protected]>wrote: > I think its a NP problem. The solution complexity can go up O(2^N) in worst > case. > > On Mon, Jun 20, 2011 at 11:55 AM, Navneet Gupta <[email protected]>wrote: > >> Given a set of integers , find a set of numbers such that they sum to a >> given number k . >> Notice the set of numbers can have 2 or more than 2 numbers. >> >> >> --Navneet >> >> -- >> 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. > -- --Navneet -- 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.
