This website is preserved for historical and scholarly reference and is no longer actively maintained.
Assignment #3
Due Monday, March 1 at midnight.
This individual programming assignment will be accepted up to two class days after the program was due. There will be penalty points deducted as follows.
turned in by midnight Monday, March 1: no points deducted
turned in by midnight Tuesday, March 2: 20 points (total) deducted
turned in by midnight Wednesday, March 3: 40 points (total) deducted
not accepted after midnight Wednesday, March 3
You are to create a new method for List.h and List.cpp. Create a file called user.cpp which tests whether or not your new method works.
You are to create a method "myFind"
ListItr <Object> List <Object>::myFind( const Object & x ) const
If the Object x is not already the first Object in the list, the
myFind method moves the Object one position closer to the front
of the list. All manipulation must be done with pointers.
Move the position of the nodes, but do not change the
internal data storage of the nodes. (This is a self-adjusting list,
as described in Arnow and Weiss.)
For example, if you do a myFind(a) on list: x-y-a-z, the list becomes x-a-y-z.
Compile your program using "CC user.cpp". The above files have all been
altered to run on CC. On some platforms you may be able to compile
using "g++ user.cpp", but warning messages will be generated. (Remember
to use "rm -r Templates.DB" between compilations when you are using CC.)
Using the handin command, turn in List.h and List.cpp. It is assumed that you have made no changes to ListItr.h and ListNode.h. Programs that do not compile will receive very little credit.
Use the required style standards .