FACTOID # 76: The fourteen unhappiest countries are all in Eastern Europe.
 
 Home   Encyclopedia   Statistics   Countries A-Z   Flags   Maps   Education   Forum   FAQ   About 
 
WHAT'S NEW
RECENT ARTICLES
More Recent Articles »
 

FACTS & STATISTICS    Simple view

  1. Select countries to view: (hold down Control key and click to select several)

     

     

    Compare:

     

     

  1. Select fact or statistic: (* = graphable)

     

     

     

  2. (OPTIONAL) Compare to statistic: (both need to be graphable)

     

     

     

  3. View result as:

     

       
(OR) SEARCH ALL encyclopedia, stats & forums:   

Encyclopedia > Perfect hashing

Perfect hash functions are hash functions which guarantee O(1) operations complexity when used in a hash table; In other words, a hash table that uses a perfect hash function guarantees that retrieving any value will take no more than some constant time, regardless of the table's size. This is opposed to a general hash function, which may, in some conditions, require a number of look-ups that is proportional to the table's size - O(n) operations.


A specific perfect hash function may achieve this operation complexity constraint by guaranteeing that for a certain list of keys (see hash table), no two keys get the same hash value. A more general way of putting this: if C is a some constant number, then no more than C keys may generate the same hash value, using this function.


Coming up with a perfect hash function for a specific data set takes in the order of O(n) operations (i.e. a number of operations that is proportional to the data-set's size);


Using a perfect hash function is best at situations where there is a large dataset which is not updated frequently, and many look-ups into it. This is because updates may require re-calculation of the perfect hash.


A minimal perfect hash function is a perfect hash function that maps n keys to n consecutive integers -- usually [0..n-1] or [1..n]. A more formal way of expressing this is: Let j and k be elements of some set K. F is a minimal perfect hash function iff F(j)=F(k) implies j=k and there exists an integer a such that the range of F is a..a+|K|-1.


See also


  Results from FactBites:
 
Hash function - Wikipedia, the free encyclopedia (1355 words)
The generally impossible/impractical ideal for a hash table's hash function is to map each key to a unique index (see perfect hashing), because this guarantees access to each data record in the first probe into the table.
Hash functions that are truly random with uniform output (including most cryptographic hash functions) are good in that, on average, only one or two probes will be needed (depending on the load factor).
The hash function is computed for the data at the sender, and the value of this hash is sent with the data.
  More results at FactBites »


 

COMMENTARY     


Share your thoughts, questions and commentary here
Your name
Your comments
Please enter the 5-letter protection code

Want to know more?
Search encyclopedia, statistics and forums:

 


Lesson Plans | Student Area | Student FAQ | Reviews | Press Releases |  Feeds | Contact
The Wikipedia article included on this page is licensed under the GFDL.
Images may be subject to relevant owners' copyright.
All other elements are (c) copyright NationMaster.com 2003-5. All Rights Reserved.
Usage implies agreement with terms.