in reply to Memory Restrictions
A simple algorythm would be something along the lines of this untested, pseudo-code example:
This should use less memory than what I imagine your solution to be. Note that showing us some of your code can help us give better answers.my @uniques = (); my $md5; while (my $string = <FILE>) { $md5 = md5hex $string; if (grep { $md5 eq $_ } @uniques) { warn "$string is not unique\n"; # or push() into another list... } else { push @uniques, $md5; } } # Now @unique contains the list of unique strings
Update: Ok, ok. I added the obligatory MD5 :).
Regards.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Memory Restrictions
by derby (Abbot) on Oct 24, 2002 at 12:46 UTC |