in reply to Out of Memory
Use a trie instead of a hash table.
For future reference,
if(exists $wordCount{$_}) { $wordCount{$_} = $wordCount{$_} + 1; } else { $wordCount{$_} = 1; }
can be shortened to
++$wordCount{$_};
It won't help your memory problem, just your code clarity.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Out of Memory
by Anonymous Monk on Oct 25, 2009 at 05:18 UTC | |
by ikegami (Patriarch) on Oct 25, 2009 at 05:39 UTC |