Programming Assignment 6
The list class
Sorting

Due: Tuesday, October 23, 11:59pm

The only file you will need for this assignment is the List.h file that we wrote in class. Our testList.cpp file might also be of use as a starting point for your test file.

Collaboration Policy

For this assignment, you must work indivicually on your program.

Please make sure you adhere to the policies on academic integrity in this regard.


Overview

Similar to our last program with vectors, we will add some functionality to our list class written during lecture. In addition, you will implement sorting algorithms for both the vector and the list classes.


Part 1

Please write the following functions described below in our List class. (Please download List.h from the course schedule webpage and insert your functions into this class, then submit the entire List.h file via email by the due date.)

NOTE: For these functions, all iterators and references to elements remain valid. Note that this means you may NOT remove elements and readd them, since this will allocate new nodes and invalidate the pointers/iterators which already exist. You'll have to get down and dirty with pointers for most of these.

Functions to code


Part 2: Sorting

You will also be implementing two sorting algorithms for this assignment, one in the list class and one in the vector class. Add them to each .h file as a member function, and clearly indicate in the name and the comments which algorithms you have chosen. Note that I don't care which algorithms you implement in particular, but you are required to do 2 different ones, one in each class.

You may wish to review these and try to take into account which sorting algorithms are easier to implement in each class!


Extra Credit

For extra credit, you may also implement the following function in the list class:


Files to Submit


Grading Standards

The assignment is worth 10 points. One point will be based on a checkpoint with the instructor on Nov. 1, at which time you will be expected to have completed at least 15 lines of code for the assignment. One point will be based on your testList.cpp file. The remaining 8 points will be based on the assigned functions (including commenting, indenting, and meaningful variable names).