sub count_frequencies { my (@strings) = @_; my $frequencies = (); for (@strings) { foreach my $i (0..length($_)-1) { $frequencies->{substr($_, $i,1)}++; } } return $frequencies; }
In reply to Re: Huffman coding in pure Perl
by Anonymous Monk
in thread Huffman coding in pure Perl
by vrk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |