CSCI 161 Lab 5: sections S26N01/2
See the main lab page for submission deadlines and
late penalties.
It is assumed you are keeping up to date with the lectures and labs.
Some additional git information is available through the
git quick notes,
git project/lab submission, and
lecture resources pages.
In this lab we start working with C++ classes, using them to build our own linked list
class and then use that class in a small application.
Be sure to follow the course code standards.
Marks will be deducted for failing to follow standards.
lab5 product requirements/specification/design
For lab5 we're tackling a similar idea as the lab4 bug collection, but with the
following differences:
- The collection is being implemented as a binary search tree rather than
a linked list, so the filenames this time around are
bugtree.h, bugtree.cpp, lab5.h, lab5.cpp, test5.h, test5.cpp.
- We've dropped the duplicate/switch aspects from the main routine.
- No duplicate bug names are allowed (even if the file is different).
- The specific methods have been adjusted to address the differing
desired behaviour above and to be more tree-appropriate.
- You're provided with a starting test5.h/cpp that runs a collection
of tests on your buglist.h/cpp code, but you're welcome to modify or expand this
as you see fit.
As with lab4, the lab5.h and lab5.cpp provide a ready-made application for using
the bugtree, and the bugtree.h provides a definition for the bugtree class.
The only files you can modify are bugtree.cpp and the test5.h/cpp, and your bugtree
implementations must follow the specifications given in bugtree.h.
Your bugtree must be a proper binary search tree implementation, with (pseudo)alphabetically-lesser
names down the left subtrees and (pseudo)alphabetically-greater names down the right subtree.
(In this particular lab there are no duplicate names permitted.)
Files in starter repo:
Here you can see copies of the files that will be provided in the starter repo:
Design
As with lab4, I'll give you a week or so to try out your own design ideas for the various methods,
then will outline some approaches I would recommend (particularly for the protected
insert, printBugs, and getName, since those are the functions doing most of the heavy work).