Dear gurus,

>From the perldoc for Devel::Peek:

    The "quality" of a hash is defined as the total number of comparisons 
needed to access 
    every element once, relative to the expected number needed for a 
random hash. The value 
    can go over 100%.

    The total number of comparisons is equal to the sum of the squares of 
the number of 
    entries in each bucket. For a random hash of "n" keys into "k" 
buckets, the expected 
    value is:

                    n + n(n-1)/2k

I'm working on some code documentation and have gotten to this point. The 
above is vaguely worded. Or maybe I should just say that it doesn't 
explicitly state what I'm looking for...  So, do I want a higher 
percentage for hash "quality," or a lower percentage?  That is, which 
direction of change signals improvement?

TIA,

Deane Rothenmaier
Programmer/Analyst
Walgreens Corp.
224-542-5150

You cannot strengthen the weak by weakening the strong. -- Abraham Lincoln
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to