|
||
Title: Find i such that S and (S+i) is maximal Post by cuckoo on Oct 21st, 2007, 8:12pm S is a set of integers. S+i={ x+i | x \in S}. Find an integer such that [ S AND (S+i) ] has maximual number of elements. AND represent set intersection. Can this problem be solved in less than O(n^2) time? (n=|S|) |
||
Title: Re: Find i such that S and (S+i) is maximal Post by towr on Oct 22nd, 2007, 2:25am You want the maximal intersection? Why not pick i=0? If you want an i>0, I think you can still do better than O(n2). Maybe use string matching techniques, or something like a convolution (using FFT-like techniques). |
||
Powered by YaBB 1 Gold - SP 1.4! Forum software copyright © 2000-2004 Yet another Bulletin Board |