[algogeeks] Re: Find all the subset of an array whose sum is equal to some number

2010-12-28 Thread shanushaan
Well All the subsets, not the number On Dec 25, 8:48 pm, juver++ avpostni...@gmail.com wrote: What you need to get for the answer - amount of such subsets or display them? First problem can be solved using DP. Second - brute force. -- You received this message because you are subscribed to

[algogeeks] Re: DIVIDE TWO VARYING LENGTH NUMBERS.

2010-12-28 Thread shanushaan
The better option will be to shift and divide. As you can store the arbitrary large number in a link list or int array. Left shift the right array and subtract, this will give you a better approach, rathar than just subtracting each time. Add them in the end .. On Dec 27, 1:47 am, Aniket

[algogeeks] Re: Find all the subset of an array whose sum is equal to some number

2010-12-28 Thread shanushaan
Thanks , I need to learn sml now :). I was looking for the conversation over algo development and hints to do that. On Dec 25, 10:04 pm, Puneet Ginoria punnu.gino...@gmail.com wrote: This attachment contains the code for the above program in SML language and it uses lambda calculus. On

[algogeeks] Re: Find all the subset of an array whose sum is equal to some number

2010-12-28 Thread shanushaan
On what basis we will divide the array. (Eg 1. Sort and divide them on positive negative ) On Dec 25, 10:52 pm, radha krishnan radhakrishnance...@gmail.com wrote: This s similar to the problemhttps://www.spoj.pl/problems/SUBSUMS/ we have to split the array into 2 arrays say A,B generate all

[algogeeks] Re: Interview question amazon

2010-12-28 Thread shanushaan
Not clear what path you are referring to. Question. Should the path include root value always? (What is problem with only left or only right path (not containing root)) In your example for 16 one more path can be 0 1 5 10 as well. Should algo return all the paths or just first one.