CPSC 221H-200: Data Structures & Algorithms
Programming Assignment #2
Spring 2009


General Guidelines for Programs


Assignment

Due: Monday February 16, 2009 by 11:59pm. Code should be turned in electronically using the mechanism described above. You should also turn in an electronic copy of your report using the same mechanism as you do for the code; the electronic copy does not need to have the signed coverpage. In addition, you should submit a hardcopy of your report (but no code). This is due at the beginning of lab on February 17, 2009; the hardcopy must include the signed coverpage.

This programming assignment concerns a doubly-linked list implementation of the List ADT. You will add variants of two of the existing list operations insertLast() and insertBefore() that use different implementions and you will compare the performance of your versions, myInsertLast() and myInsertBefore(), with the already provided insertLast() and insertBefore(). This will give you practice implementing linked lists and will allow you to see how the choice of implementation can affect performance.

Coding Portion. (50 points)

Report. (50 points)

You will write a brief report that includes theoretical analysis, a description of your experiments, and discussion of your results. At a minimum, your report should include the following sections:

  1. Introduction. In this section, you should describe the objective of this assignment.
  2. Theoretical analysis. In this section, you should provide an analysis of the running time of your myInsertLast() and myInsertBefore() methods assuming there are N elements in the list when the functions are invoked. Express your answer using asymptotic notion. Compare the theoretical efficiency of these new versions of myInsertLast() and myInsertBefore() methods with the provided implementations of insertLast() and insertBefore(). You must explain your reasoning to receive full credit.
  3. Experimental Setup. In this section, you should provide a description of your experiment setup, which includes but is not limited to
  4. Experimental Results. In this section, you should compare the performance (running time) of insertLast() and insertBefore() and myInsertLast() and myInsertBefore(), respectively, to each other and to their theoretical complexity.