CS223-0219-Hashing

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

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

View Full Document Right Arrow Icon
CS223 Advanced Data Structures and Algorithms 1 Hashing Hashing Neil Tang Neil Tang 02/19/2008 02/19/2008
Background image of page 1

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

View Full DocumentRight Arrow Icon
CS223 Advanced Data Structures and Algorithms 2 Class Overview Class Overview Basic idea Hashing functions
Background image of page 2
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.
Background image of page 3

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

View Full DocumentRight Arrow Icon
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
Background image of page 4
Background image of page 5

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

View Full DocumentRight Arrow Icon
Background image of page 6
Background image of page 7

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

View Full DocumentRight Arrow Icon
Background image of page 8
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 Right Arrow Icon
Ask a homework question - tutors are online