Computer Science 331 — Hash Tables

A Hash Table

Hash Tables

Overview

Hash tables are also data structures that can be used to implement finite sets and mappings. Their worst-case performance is not very good, and their analysis is complicated — but they work extremely well in practice (especially when used to represent a set or mapping that does not change very much) and they can be proved to have very good “expected” performance under certain assumptions.

Two kinds of hash tables — “hash tables with chaining” and “hash tables with open addressing” — will be presented and discussed. A few other kinds of hash tables will be more briefly described.

Lecture #12: Hash Tables — Part One

Required Reading

Lecture Presentation

Code Supplied with This Lecture

Hash Functions for Hash Tables with Chaining

A Hash Table with Chaining

Implementation of a Set Using a Hash Table with Chaining

Implementation of a Mapping Using a Hash Table with Chaining

Reading Exercise #3: Hash Functions

Lecture #13: Hash Tables — Part Two

Required Reading

Lecture Presentation

Code Supplied with This Lecture

Hash Functions for Hash Tables with Open Addressing

Implementation of a Hash Table with Open Addressing

Reading Exercise #4: Randomization and Hashing

Tutorial #12: Hash Tables

Test Results

Code To Be Completed

Implementation of a Set (Use After Completing the Above)

Implementation of a Mapping (Use After Completing the Above


University of Calgary Extension of Logo
Department of Computer Science

cpsc 331 computer science faculty of science u of c

cpsc 331 intro and math review analysis of algorithms basic data structures and adts search trees hash tables searching and sorting graph algorithms java develoment exercises assignments tests