isn't it knapsack problem ? On Fri, Jul 29, 2011 at 4:29 PM, ankit sambyal <ankitsamb...@gmail.com>wrote:
> @aman: My mistake. > set* memo[0]=0* > > The revised algo is : > > > Algo: > 1. int memo[S] > 2. initialize all its elements to infinite. > * > 3.memo[0]=0* > > 4.for i=1 to S > for j=0 to N-1 > if(denom[j] < i && memo[i-denom[j]] +1 < memo[i]) > memo[i]=memo[i-denom[j]] +1 > 5. return memo[S] > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- Ankur Khurana Computer Science Netaji Subhas Institute Of Technology Delhi. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.