cpsc 319 n.
Download
Skip this Video
Download Presentation
CPSC 319

Loading in 2 Seconds...

play fullscreen
1 / 7

CPSC 319 - PowerPoint PPT Presentation


  • 117 Views
  • Uploaded on

CPSC 319. Dr. Marina Gavrilova Computer Science University of Calgary Canada. Perfect Hashing Cichelli’s Algorithm. Outline. Perfect Hashing.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'CPSC 319' - scarlet-christensen


Download Now An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
cpsc 319

CPSC 319

Dr. Marina Gavrilova

Computer Science

University of Calgary

Canada

outline
Perfect Hashing
  • Cichelli’s Algorithm
Outline
slide3

Perfect Hashing

  • A perfect hashing function maps a key into a unique address. If the range of potential addresses is the same as the number of keys, the function is a minimal (in space) perfect hashing function.
  • What makes perfect hashing distinctive is that it is a process for mapping a key space to a unique address in a smaller address space, that is

hash (key) unique address

  • Not only does a perfect hashing function improve retrieval performance, but a minimal perfect hashing function would provide 100 percent storage utilization.
slide4

Perfect Hashing

Process of creating a perfect hash function

A general form of a perfect hashing function is:

p.hash (key) =(h0(key) + g[h1(key)] + g[h2(key)] mod N

slide5

Cichelli’s Algorithm

  • In Cichelli’s algorithm, the component functions are:

h0 = length (key)

h1 = first_character (key)

h2 = last_character (key)

andg = T (x)

where T is the table of values associated with individual characters x which may apply in a key.

The time consuming part of Cichelli’s algorithm is determining T.

slide6

Cichelli’s Algorithm

Table 1: Values associated with the characters of the Pascal reserved words

  • When we apply the Cichelli’s perfect hashing functionto the keyword begin using table 1, we can get –

The keyword begin would be stored in location 33. Since the hash values run from 2 through 37 for this set of data, the hash function is a minimal perfect hashing function.