set.h:
Header file for this version of the Set class.
You don't have to write much of this file.
Just copy our version from
set.h
and add your name and other information at the top.
You may also add more private member functions if you like.
Notice that the set is NOT a template class. It is easier to
debug with the Item type fixed as a double.
set.cxx:
The implementation file for the new
Set class. You will write this yourself, including all the
private member functions described in Section 11.2. Put a
precondition/postcondition contract with each private function's
implementation.
NOTE: Some of you have been forgetting to put your name and a
clearly written invariant at the top of this file. The TAs will
start taking off points for such omissions.
makefile:
This is a makefile for the assignment.
The file should contain targets for set.o,
setexam.o, and setexam (an
executable file). The source code for setexam.cxx
is available in the locations listed below. Your makefile should
also include "all" and "clean" options. NOTE: Dora won't test your
makefile, but the TAs will take off points if it is incomplete.
Include your name in a comment at the top.
setexam.cxx:
A non-interactive test program that will
be used to grade the correctness of your Set class.
Your Set class for this assignment will use a B-tree as described in Section 11.2. You may use a typedef statement defining the Item type as a double number (rather than implementing a template class). In order for you to further learn how to use private member functions, I would like for you to write and use all the private member functions that are listed in set.h. You should write precondition/postcondition contracts for these functions are given in your implementation file.
For easier debugging, carry out this assignment in two parts. Part A should include everything except the public remove member function and the private functions that are needed for removal (i.e., loose_remove, remove_biggest, and fix_shortage). Once Part A is working and tested, you may complete the assignment by implementing the remove member function and its associated private functions.
Use your own interactive test program and the debugger to track down errors in your implementation. If you like, you may share an interactive test program with another student, but do not look at another student's b-tree. If you have an error, do not start making changes until you have identified the cause of the error. If you come to me or a TA for help, we will always ask you to do the following: