Algorithm Analysis (CSC 301 2015F) : Outlines
Primary: [Front Door] [Schedule] - [Academic Honesty] [Disabilities] [Email] [FAQ] [IRC] [Teaching & Learning]
Current: [Outline] [EBoard] [Reading] [Lab] [Assignment]
Sections: [Assignments] [EBoards] [Examples] [Handouts] [Labs] [Outlines] [Readings]
Reference: [Algorist]
Related Courses: [Walker (2014F)]
Misc: [SamR] [Glimmer Labs] [CS@Grinnell] [Grinnell] [Issue Tracker]
Held: Wednesday, 16 September 2015
Back to Outline 08 - Roles of Data Structures and Abstract Data Types. On to Outline 10 - An Introduction to Trees.
Summary
We consider hash tables, one of the more popular implementations of the dictionary ADT.
Related Pages
Overview
Administrivia
SetOfStrings Implementations
SetOfStrings ADT provides
add(set,val), remove(set,val), contains(set,val)union(set,set), subtract(set,set)SetofStrings.
(You need not write code; just describe memory arrangement and
related issues.)With your group
With your group
Function borrowed from Skienna p. 89; expects arbitrary-precision integers
#define alpha SOME_LARGE_PRIME
int hash(char *s)
{
int len = strlen(s);
int code = 0;
for (int i = 0; i < len; i++)
{
code += s[i] * expt(alpha, len-(i+1))
} // for
return code;
} // hash
hash(substring(str, 0, k)) and hash(substring(str, 1, k+1))?Ideas stolen from Skiena
How could you use hash functions or tables to help you ...
a is a substring of string b?