sort all 3 arrays. then for any every combination of numbers in 2 arrays say, a and b do a binary search for element -(a+b) in the third array. It would be a O(N^2 logN) algorithm On Tue, Jan 11, 2011 at 12:04 PM, Decipher <ankurseth...@gmail.com> wrote:
> Given three lists: A, B and C of length n each. Write a function which > returns true if any 3 three numbers (1 from each list), sum up to zero. Else > return false, if there is no such combination. > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algoge...@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@googlegroups.com> > . > 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 algoge...@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.