Subj : Re: puzzle To : comp.programming From : pete Date : Tue Jun 28 2005 12:39 pm spinoza1111@yahoo.com wrote: > Given enough of anything, anything will work. The point being that the > problem is O(n^2) and not O(n) because you have to introduce a > conversion magical from the standpoint of theory to make it O(n), one > that has practical results in the form of obfuscated code. The problem is O(n^2)???!!! Oh no, hell no! Richard Harter has already described a very clever O(n) solution which has to do with partitioning. This thread started 10 June. By 11 June, Christopher Barber had already posted an O(n * log(n)) solution, http://groups-beta.google.com/group/comp.programming/msg/968528dd9eaaab3f .... which I coded and posted on 21 June. http://groups-beta.google.com/group/comp.programming/msg/f1c25c29e3f454af Where have you been during this thread? Have your tears of shame obscured your vision? Are you on crack? -- pete .