Computer Science 269
Introduction to Data Structures
Spring 2000
Assignment 2
Due February 4, 2000.

-
It is expected that students will discuss the assignments. But do
not turn in code written by another person. If that happens, both
persons are violating the ethics of this course. Representing the
work of another person as your own is plagiarism, and may result in
a disciplinary "F" in the course.
It is permissable (in this course, as this is up to the instructor)
for you to obtain ideas from other students or from other persons.
But you must type in the code yourself.
It is unadvisable for you to allow another student to have an electronic
copy of your work, as then you would unwittingly be a party to a breach
of these rules. Showing the other student a hard copy is less dangerous.
The above rule does not apply to copying files that I have made publicly
available. I expect that you will use those in their original form or
with appropriate modifications (made by just you, of course).
-
Write a class type called bag which has
methods insert , find , and
remove . You may also need to write a constructor.
Use a list implementation.
The method remove does nothing visible to the user
if the item to be removed is not in the bag.
Your code should be compatible with the
code for main( ) which
I provide. Output of that program.
-
May students will perhaps want to know details such as, "Do I have to
use a sorted list?" The answer to all those questions is that there
are many different list implementations of the ADT in question, and
you may use any one of them. Make up your own if you want; in fact,
I encourage you to attempt that.
-
What ADT is being implemented here?
-
Files you need for this assignment:
You may also access copies of those files using the link on the course
page.
