Return to labs index
Thursday, October 28th at 11:59PM (Assignment #6 - Linked List Dictionary)
Due: Thursday, October 28th at 11:59PM (Tuesday)


This lab asks you to implement a dictionary library via a dynamically allocated linked list of strings. But the program surrounding it is more rudimentary than last week. Instead, it should be tested via a shell script -- which is also to be turned in for grading.

The Dictionaries

The "dictionary" that serves as this lab's main data structure is conceptually the same as last week -- but this time implemented using a linked list. As a result, there should be no periodic grow().

Please use the following type for the dictionary:

  typedef struct {
    linkedlist *wordList;
    unsigned long count;
  } dictionary;

The dictionary should be implemented as a library and, as such, should make use of appropriately named and configured .c and .h files.

The dictionary should support the following operations:

The Linked List

You should implement a linked list data structure similar to the one we began in class. You may not use anyone else's source or library code here. And, yes, it should be generic. Really, why not?

Main Program

Your main program should be very rudimentary. It should provide the user with a prompt, dictionary> and accept the following commands add, remove, query, dump, reset, and quit:

The Shell Script Test Driver

You should write a shell script to exercise your dictionary. It should, at the very least, do the following:

The output of the test driver should print, before a test begins, a very short description of the test, followed by a :-colon, followed by one space, followed by "success" or "fail". Each test should be reported on a separate line. For example:

  Add words:    success
  Verify words: success
  Remove words: failure

Code organization and Coding Practices

All aspects of the program, including the script, should satisfy the various code organization and coding practices that we've developed within class.

We're Here To Help!

As always -- remember, we're here to help!