Table of Contents

Corning Community College

CSCS2320 Data Structures

PROJECT: Lists - Doubly-Linked Lists of Nodes (DLL1)

OBJECTIVE

To continue our journey on doubly-linked data structures, and collaboratively authoring and documenting the project and its specifications.

OVERVIEW

We continue now delving into the realm of doubly-linked data structures. This project: we complete on our doubly-linked list implementation.

UPGRADING

To assist with consistency across all implementations, project files for use with this project, along with the integration of the work you did on the last project, is made possible via a special recipe in the Makefile.

Simply go into the project base directory, and run:

lab46:~/src/SEMESTER/DESIG/prevPROJECT$ make upgrade-dll1

EDIT

You will want to go here to edit and fill in the various sections of the document:

BACKGROUND

SPECIFICATIONS

This week we are working on the following functions:

  • obtain
  • empty
  • rmlist
  • compare
  • swapnode
  • sortlist

The way in which you proceed through these functions only matter if you want to use functions inside other functions. Unit tests this week do not rely upon other functions created this week to work. Some unit tests will make use of functions made last week, for dll0. Make sure that your cplist works well because that is found commonly throughout the unit tests.

Some possible combinations to get you going: empty inside rmlist, obtain inside empty, swap inside sort. There are more combinations possible to reduce the amount of reinventing that your doing of the wheel, but these are a few to just get you started on the idea of combining functions inside other functions.

*Our task is to ask questions on Discord or in class and document our findings on this wiki page collaboratively, regarding the functionality of this project.

*For anybody interested in editing the wiki page, here is the dokuwiki user guide: https://www.dokuwiki.org/wiki:syntax#basic_text_formatting -Ash

PROGRAM

It should be noted that the new compare is quite similar to the sllx version, therefore drawing inspiration from the code one wrote previously may be of assistance.

For the new rmlist function, like the one in the previous sllx projects, it would be wise to work on the empty function first (similar to that of the clear function in the sllx projects). That way when you want to deallocate a list, you can call the empty function to clear up the nodes within the list to ensure there is no memory leak.

NOTE If you are trying to work on this project without a fully functional dll0 library, you are still able to complete this project, and get full credit (if new implementations pass all the test cases). To do this, in your root folder of dll1 type: make use-test-reference. Rather than using your implementations of previous functions, your make will now use working implementations ONLY of functions from previous dllX's.

OUTPUT SPECIFICATIONS

No output to stdout for any of these functions, all functions should modify the list in some way, shape, or form.

UNIT TESTS

Total of 162 tests. Unit tests are called with make check, similar to every other week. Safe practice to make clean before every make to ensure old results are cleaned up. There will be an errors file created after running make, it’s a good idea to check this as well. Tests are split amongst all the functions, with 7 going to empty and rmlist. Compare, Swap, Sort, and Obtain have 12, 31, 48, and 57 tests respectively. While unit tests do a good job of ensuring basic functionality, ensure that your functions can work with any provided input. To be specific, if you're going to use swap inside sort(a good idea), make sure your swap can handle functions side by side anywhere in the list. The unit test for swap does not check for this.

Additionally, if one wishes to be shown any compiling errors/warnings immediately, one could use “make debug” to do so, as this will reroute the contents of the make to stdout instead of the errors file.

 

SUBMISSION

To be successful in this project, the following criteria (or their equivalent) must be met:

Submit Tool Usage

Let's say you have completed work on the project, and are ready to submit, you would do the following:

lab46:~/src/SEMESTER/DESIG/PROJECT$ make submit

You should get some sort of confirmation indicating successful submission if all went according to plan. If not, check for typos and or locational mismatches.

RUBRIC

I'll be evaluating the project based on the following criteria:

91:dll1:final tally of results (91/91)
*:dll1:obtained project by the Sunday prior to duedate [13/13]
*:dll1:clean compile, no compiler messages [13/13]
*:dll1:implementation passes unit tests [26/26]
*:dll1:adequate modifications to code from template [13/13]
*:dll1:program operations conform to project specifications [13/13]
*:dll1:code tracked in lab46 semester repo [13/13]

Pertaining to the collaborative authoring of project documentation

Additionally