lab05 : Generic Binary Search Tree
num | ready? | description | assigned | due |
---|---|---|---|---|
lab05 | true | Generic Binary Search Tree | Thu 02/17 09:00AM | Wed 02/23 10:00PM |
Collaboration policy
May be done solo or with the same partner as lab04.
Before completing this lab see the video recording of Lecture 13 on templates on Gauchospace.
Note that this assignment was previously an extra credit portion of lab04. However, since generic programming is one of the topics that you will be assessed on, completing this lab is required and not just extra credit. If you already completed the previously “extra credit” portion of lab04 and received a full score, then you have effectively completed this assignment
Goals
Your task is to convert your BST from lab04 to work with any generic type of keys (not just ints). For convenience, we will not change any of the file or data structure names, but your structure should be useable as IntBST
Since templates only provide a blueprint for the defintion of a class (or function), your implementations of the class IntBST
So, your intbst.h should be structured as follows:
#ifndef INTBST_H
#define INTBST_H
#include <iostream>
using namespace std;
// Replace the following existing definition of IntBST with the new class definition
class IntBST {
...
...
};
//end of class definition
#include "intbst.cpp"
#endif
Submit both intbst.cpp and intbst.h to the lab05 assignment on Gauchospace.