Dr. Marina Gavrilova CPSC 335 Computer Science University of Calgary

Slides:



Advertisements
Similar presentations
Dana Shapira Hash Tables
Advertisements

HASH TABLE. HASH TABLE a group of people could be arranged in a database like this: Hashing is the transformation of a string of characters into a.
CPSC 335 Dr. Marina Gavrilova Computer Science University of Calgary Canada.
Hashing Algorithm 羅正鴻 林彥廷 戴嘉宏.
CPSC 335 Dynamic Programming Dr. Marina Gavrilova Computer Science University of Calgary Canada.
CPSC 335 Computer Science University of Calgary Canada.
Introduction to Perfect Hashing Schemes
Min Chen School of Computer Science and Engineering Seoul National University Data Structure: Chapter 10.
Packed Object Synchronization Introduction Many Java applications and frameworks must deal directly with native data. Packed Objects provide an approach.
CPSC 335 Randomized Algorithms Dr. Marina Gavrilova Computer Science University of Calgary Canada.
Packet Classification using Tuple Space Search
Hashing Sections 10.2 – 10.3 CS 302 Dr. George Bebis.
Can’t provide fast insertion/removal and fast lookup at the same time Vectors, Linked Lists, Stack, Queues, Deques 4 Data Structures - CSCI 102 Copyright.
Dictionaries and Hashing CSCI 3333 Data Structures.
Hashing (part 2) CSE 2011 Winter March 2018.
Memory Management Virtual Memory.
Design & Analysis of Algorithm Hashing
Fundamentals of Programming II Bucket Sort: An O(N) Sort Algorithm
Indexing Structures for Files and Physical Database Design
Data Structures Using C++ 2E
Hashing Jeff Chastine.
COMP 53 – Week Eleven Hashtables.
Hashing, Hash Function, Collision & Deletion
CSCI 210 Data Structures and Algorithms
Alternative method for dictionary building : Hashing
LEARNING OBJECTIVES O(1), O(N) and O(LogN) access times. Hashing:
Slides by Steve Armstrong LeTourneau University Longview, TX
Data Structures and Algorithms
Hashing - Hash Maps and Hash Functions
Operating Systems (CS 340 D)
Lecture 21: Hash Tables Monday, February 28, 2005.
Database Management System
Subject Name: File Structures
Height Balanced Trees CPSC 335 Dr. Marina Gavrilova Computer Science
Hashing Alexandra Stefan.
Data Structures Using C++ 2E
Searching.
Dynamic Hashing.
Advanced Associative Structures
Hash Table.
Hash Table.
CS222P: Principles of Data Management Notes #6 Index Overview and ISAM Tree Index Instructor: Chen Li.
Chapters 17 & 18 6e, 13 & 14 5e: Design/Storage/Index
Hash In-Class Quiz.
Computer Science 2 Hashing
Lecture#12: External Sorting (R&G, Ch13)
Chapter 10 Hashing.
Teach A level Computing: Algorithms and Data Structures
Dictionaries and Their Implementations
Resolving collisions: Open addressing
CPSC 457 Operating Systems
COMPUTER 2430 Object Oriented Programming and Data Structures I
Recitation Outline C++ STL associative containers Examples
Copyright © Cengage Learning. All rights reserved.
Advance Database System
CS202 - Fundamental Structures of Computer Science II
A Hash Table with Chaining
Hashing Sections 10.2 – 10.3 Lecture 26 CS302 Data Structures
CS222/CS122C: Principles of Data Management Notes #6 Index Overview and ISAM Tree Index Instructor: Chen Li.
Overview of Query Evaluation
C021TV-I2-S2.
Number Systems Instructions, Compression & Truth Tables.
File Organization.
Podcast Ch21a Title: Hash Functions
Advance Database System
17CS1102 DATA STRUCTURES © 2018 KLEF – The contents of this presentation are an intellectual and copyrighted property of KL University. ALL RIGHTS RESERVED.
CS222/CS122C: Principles of Data Management UCI, Fall 2018 Notes #05 Index Overview and ISAM Tree Index Instructor: Chen Li.
Chapter 13 Hashing © 2011 Pearson Addison-Wesley. All rights reserved.
Chapter 5: Hashing Hash Tables
Lecture-Hashing.
Presentation transcript:

Dr. Marina Gavrilova CPSC 335 Computer Science University of Calgary Canada

Outline Perfect Hashing Cichelli’s Algorithm

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.

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

Cichelli’s Algorithm In Cichelli’s algorithm, the component functions are: h0 = length (key) h1 = first_character (key) h2 = last_character (key) and g = 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.

Cichelli’s Algorithm Table 1: Values associated with the characters of the Pascal reserved words When we apply the Cichelli’s perfect hashing function to 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.

Cichelli’s Algorithm Cichelli’s algorithm for determining a perfect hash function

Thank You