in reply to Re: When does Perl double the number of buckets in hash?
in thread When does Perl double the number of buckets in hash?
the output is :7/8 can some-one Explain???
No! It is easy to see that keys 11 & 15 each hash to the same bucket as one of the previous keys, as the buckets used number doesn't increase when they are added:
$hash{ $_->[0] } = $_->[1] and print "@$_\t", scalar keys %hash, scala +r %hash for [1,2],[3,4],[5,6],[7,8],[9,10],[11,12],[15,16],[22,34],[88,99] +;; 1 2 1 1/8 3 4 2 2/8 5 6 3 3/8 7 8 4 4/8 9 10 5 5/8 11 12 6 5/8 * 15 16 7 5/8 * 22 34 8 6/8 88 99 9 7/8 ???
But why the size of the hash was not doubled when the key count equalled the number of buckets is not clear. It seems to suggest that this is also not the complete story here?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: When does Perl double the number of buckets in hash?
by Anonymous Monk on Dec 02, 2011 at 18:17 UTC | |
by BrowserUk (Patriarch) on Dec 02, 2011 at 20:16 UTC | |
by ikegami (Patriarch) on Dec 03, 2011 at 02:05 UTC | |
|
Re^3: When does Perl double the number of buckets in hash?
by ikegami (Patriarch) on Dec 03, 2011 at 02:10 UTC |