ch12 - Chapter 12 Hash Table Review Hash Tables Factorial...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Chapter 12 Hash Table Review Hash Tables Factorial Integer Hashing String Based Hash Functions Storage and Retrieval Collisions Linear Probing Double Hashing Separate Chaining Buckets Hashing Analysis Hashing Discussion Review So far we have seen a number of ADTs for storing and retrieving data. The search times for these ADTs vary Review So far we have seen a number of ADTs for storing and retrieving data. The search times for these ADTs vary significantly. Review ADT Search Time array O(N) unsorted O(logN) sorted linked list O(N) sorted or unsorted stack O(1) for top only queue O(1) for head/tail only binary tree O(logN) for any value heap O(logN) for largest value Hash Tables A hash table is a data structure invented for very fast data storage and retrieval. Goal is to look for data in 1 step using the data itself to tell you where to look. We use a hash function to map data values into table positions. eg: hash(john) = 42 so we store john in position 42. john 0 1 2 42 Hash functions are many to one, so we need an algorithm to resolve collisions (where 2 values map to the same table position). Integer Hashing Assume that we want to store/retrieve 100 student records by their ID. We could allocate an array 1,000,000 long use ID as the index, but this would waste a lot of space....
View Full Document

This note was uploaded on 12/01/2011 for the course CSCE 2014 taught by Professor Gauch during the Spring '11 term at Arkansas.

Page1 / 15

ch12 - Chapter 12 Hash Table Review Hash Tables Factorial...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online