And we have to find all the elements of the set S using the sum method...
hence we don't have the members of the set S.

The method hence should more likely be like SUM(K) which returns TRUE or
FALSE if there's a subset, sum of whose elements is equal to k.

It is a very interesting problem...

On 3/30/07, Dhruva Sagar <[EMAIL PROTECTED]> wrote:
>
> No there's no assumptions...
> How can it be sub string?
> Say a set S = {1,4,12,62,11,3}
>
> we are given an algo say SUM(S,k) which returns TRUE or FALSE if the set S
> has a subset, sum of whose elsements is equal to K
>
> SUM(S,5) = TRUE    (subset = {1,4} 1+4 = 5)
> SUM(S,74) =TRUE   (subset = {1,62,11} 1+62+11 = 74)
> SUM(S,&) = FALSE (no subset...)
>
> On 3/30/07, Shalin Shah <[EMAIL PROTECTED] > wrote:
> >
> >
> >
> > > We have set named S. We assume we have an algorithm that specifies if
> > > there is a subset in S that sum of it's elements equals to K in O(n)
> > > and returns TRUE or FALSE.
> >
> > That assumption is either wrong, or you have specified the problem
> > incorrectly. Is "subset" the right word? Do you mean "substring"
> >
> --
> Thanks & Regards,
> Dhruva Sagar.




-- 
Thanks & Regards,
Dhruva Sagar.

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/algogeeks
-~----------~----~----~----~------~----~------~--~---

Reply via email to