could u please explain ur soln via abinary serach??
On 22 July 2012 19:14, Victor Manuel Grijalva Altamirano <
[email protected]> wrote:
> on solution it's with brute force, with three for's,
> for i=0; i<lengthS (to find a)
> for j=0; j<lengthS (to find b)
> for k=0; k<lengthS (to find c)
> if(i!=j and j!=k and i!=k)
> if(s[i]+s[j]+s[k]==0)printf("find it")
>
>
> other solution it's with binary search.
>
> 2012/7/22 lomash goyal <[email protected]>
>
>> Given an array *S* of *n* integers, are there elements *a*, *b*, *c* in *
>> S* such that *a* + *b* + *c* = 0? Find all unique triplets in the array
>> which gives the sum of zero.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msg/algogeeks/-/3cOK_JrSYEsJ.
>> 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.
>>
>
>
>
> --
> Victor Manuel Grijalva Altamirano
> Universidad Tecnologica de La Mixteca
>
> --
> 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.
>
--
aviNash
--
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.