in reply to Memory Restrictions
Try working out an algorithm where you start by comparing, say, the first 80 characters of each text, put aside the ones that are unique on this basis, and only do pair-wise comparisons of texts that are identical on this basis.
Another possibility, if "equality" is supposed to mean "byte level identity" among the texts: read each one, one at a time, and generate an MD5 signature or checksum for it. Now just compare the checksum signatures -- in fact, just sort them and look for consecutive values that are identical; those will be identical texts.
update: If the texts vary in size, even a little bit, just comparing sizes might be a good thing to start with. If you want to ignore differences in white-space characters (like "diff -b"), read the texts one at a time and normalize white-space before noting their lengths (and generating checksums).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Memory Restrictions
by perrin (Chancellor) on Oct 24, 2002 at 03:24 UTC |