Data Structures
CS 221
Dr. Leap
Fall, 1999
 Syllabus
 Outline
 Grades    

Linked List Assignment

In order to understand singly linked lists well, it is important to implement singly linked lists in many different ways.  For this assignment, you are going to use the web to generate input for your program.  A form will be used to submit input fields to your program.  Your program will run as a cgi script. The nodes on the linked list should have two information fields:  one for the name of the input field and one for the value.  You must design a class based on a linked list to handle the data from the form.  The class must contain at least the following member functions:

  1. A constructor to create an empty list.
  2. A destructor that will delete all nodes on the list.
  3. A function to read the input fields from the form into nodes which are inserted onto the list.
  4. An insert function to make a node, store the name and value passed as parameters to the function and insert the node into the list.
  5. A remove function to remove the first node from the list and discard it.
  6. A print function to print the name and value of all the input fields on the list.
  7. A get function which given the name of a field will return the value of that field.
 
   
You should solve this problem two different ways:
  • First, create a class that has only a Head pointer to the linked list and processes the nodes in last-in first-out order (like a stack).
  • Second, create a class that has both Head and Tail pointers and processes the nodes in first-in first-out order.
Write at least two different forms for testing your cgi programs.  Each form should have five or more input fields on it.  Make your cgi program display all the fields from the form as a returned web page before it exits.

A sample form that can be used as a test form can be found in bluejay at: /home/leap/cs221/html/test.html.


HomeFacultyProgramsStudentsOpportunities
Department LinksAffiliated ClubsFacilitiesResearchContact

About EtownAcademicsAdministrativeAdmissionsAlumni Relations
Etown SportsnetLibraryComputingNews @ EtownStudent Life


Copyright © 1999 Elizabethtown College
All Rights Reserved Maintained by Dr. Thomas Leap

Last updated on November 5, 1999 10:23:31