CS-183 Homework Assignment 4
Dr. Mark J. Sebern
Assignment
Starting with the ListInt container (and corresponding node
and iterator classes) developed together in lecture, make the following modifications:
- Implement the ListInt copy constructor.
- Define and implement the ListInt assignment operator. (Note that the
copy constructor and assignment operator should result in a container with copies of all
the elements in the source list. Of course, the assignment operator has to get rid of any
elements that were already in the target list.)
- If you find any errors in the original "developed in class" code, describe
them and fix them if you can.
- Modify the test program (tstlisti.cpp) to test your copy constructor and
assignment operator, but don't get carried away in enhancing it.
Submission
The assignment (in one text file, including program output) should be submitted
by email to Dr. Sebern. Please keep a backup copy in
case your work gets lost in the email system. Please be sure to include your name in the
assignment text file.
This assignment is due before the start of class on Tuesday of week 10.
If you have any questions, or any part of the assignment is unclear, please consult the
instructor.
This page was last updated on May 12, 1999; send comments to Mark Sebern.
Copyright information