CS223-0219-Hashing

# CS223-0219-Hashing - among the cells. Collision (two keys...

This preview shows pages 1–8. Sign up to view the full content.

CS223 Advanced Data Structures and Algorithms 1 Hashing Hashing Neil Tang Neil Tang 02/19/2008 02/19/2008

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
CS223 Advanced Data Structures and Algorithms 2 Class Overview Class Overview Basic idea Hashing functions
CS223 Advanced Data Structures and Algorithms 3 Basic Idea Basic Idea Hash table is an array of some fixed size, containing the items. Each item has a key. Hashing is a technique used for performing insertions, deletions and searches in constant average time. Hashing is the implementation of hash tables.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
CS223 Advanced Data Structures and Algorithms 4 Basic Idea Basic Idea A hash function maps a key into some number in the range [0, TableSize-1]. An ideal hash function can distribute the keys evenly

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: among the cells. Collision (two keys hash to the same value) is the major issue of hashing. CS223 Advanced Data Structures and Algorithms 5 An Example An Example CS223 Advanced Data Structures and Algorithms 6 A Simple Hash Function A Simple Hash Function If TableSize = 10007, the hash function can only assume values [0,127*8]. CS223 Advanced Data Structures and Algorithms 7 Another Hash Function Another Hash Function Only 2851 combinations, i.e, only 28% of the table can be hashed to. CS223 Advanced Data Structures and Algorithms 8 The 3rd Hash Function The 3rd Hash Function...
View Full Document

## This note was uploaded on 04/17/2008 for the course CS 223 taught by Professor Tang during the Spring '07 term at MSU Bozeman.

### Page1 / 8

CS223-0219-Hashing - among the cells. Collision (two keys...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online