CSC161 2010F Imperative Problem Solving
[Skip to Body]
Primary:
[Front Door]
[Schedule]
-
[Academic Honesty]
[Instructions]
Current:
[Outline]
[EBoard]
-
[Assignment]
[Lab]
Groupings:
[EBoards]
[Assignments]
[Examples]
[Exams]
[Handouts]
[Labs]
[Outlines]
[Readings]
Related Courses:
[CSC195 2003S (Rebelsky)]
[CSC161 2009F (Coahran)]
[CSC161 2010S (Walker)]
Misc:
[SamR]
[ISO]
[GNU Coding Standards]
Assigned: Friday, 19 November 2010
Due: 11:00 p.m., Wednesday, 24 November 2010
This assignment is also available in PDF.
Summary: In this assignment, you will extend our implementation of hash tables.
Purposes: To give you more experience with pointers and structures.
Expected Time: Three to four hours.
Collaboration: I encourage you to work in groups of two or three students. However, you may work on your own or in groups of up to size four. You may discuss the assignment with anyone you wish, provided you clearly document such discussions.
Submitting: Email me a tarball of your important files (your
.c
files, your .h
files, your Makefile
,
a typescript of a sample session, and anything else you deem appropriate).
Warning: So that this assignment is a learning experience for everyone, I may spend class time publicly critiquing your work.
In class, we developed a simple implementation of hash tables, based on the code in K&R. In particular, we
We now have a limited hash table library. But many clients will want a richer library, one with more functions. In this assignment, you will add functions.
Add the following functions to the hash table implementation and update the two test programs to work with them.
int contains_key (struct hash *hashtab, char *key)
hashtab
has an entry with key key
.char *find_key (struct hash *hashtab, char *value)
NULL
.void delete (struct hash *hashtab, char *key)
void iterate (struct hash *hashtab, void (*fun)(char *key, char *value))
fun
on every key/value pair in the hash table.void free_hash (struct hash *hashtab)
hashtab
.
Thursday, 18 November 2010 [Samuel A. Rebelsky]
Friday, 19 November 2010 [Samuel A. Rebelsky]
http://www.cs.grinnell.edu/~rebelsky/Courses/CSC161/2010F/Assignments/assignment.09.html
.
[Skip to Body]
Primary:
[Front Door]
[Schedule]
-
[Academic Honesty]
[Instructions]
Current:
[Outline]
[EBoard]
-
[Assignment]
[Lab]
Groupings:
[EBoards]
[Assignments]
[Examples]
[Exams]
[Handouts]
[Labs]
[Outlines]
[Readings]
Related Courses:
[CSC195 2003S (Rebelsky)]
[CSC161 2009F (Coahran)]
[CSC161 2010S (Walker)]
Misc:
[SamR]
[ISO]
[GNU Coding Standards]
Disclaimer:
I usually create these pages on the fly
, which means that I rarely
proofread them and they may contain bad grammar and incorrect details.
It also means that I tend to update them regularly (see the history for
more details). Feel free to contact me with any suggestions for changes.
This document was generated by
Siteweaver on Fri Nov 19 09:08:55 2010.
The source to the document was last modified on Fri Nov 19 09:08:49 2010.
This document may be found at http://www.cs.grinnell.edu/~rebelsky/Courses/CSC161/2010F/Assignments/assignment.09.html
.