//tbstree.cpp
//test driver for class BSTree (Binary Search Tree)
#include
#include
#include
#include "bstree.h"
const char* bst = "Binary Search Tree:\n";
main() { BSTree *BST = new BSTree;
assert(BST);
BSTree *BST1 = new BSTree(111);
assert(BST1);
int u[15] = {22,54,12,80,2,11,45,60,8,20,30,15,1,81,19}; int r[15] = {7,10,10,10,2,2,10,5,8,8,5,2,2,2,7};
assert (BST->isempty());
assert (!BST->find(22));
cout<<"After constructor with parameter:\n"<print();
assert(!BST1->isempty());
assert (BST1->find(111));
assert (!BST->find(-15));
cout<<"Testing various inputs:\n\n"
<<"-- unsorted input\n";
int i;
for (i = 0; i < 15; i++)
BST->insert(u[i]);
cout<print();
assert (!BST->isempty());
assert(BST->find(1));
assert(BST->find(22));
assert(BST->find(81));
assert(!BST->find(33));
cout<<<"-- input in ascending order\n";
BSTree BSTa;
for (i = 0; i < 15; i++)
BSTa.insert(i);
cout<<<"-- input in descending order\n";
BSTree BSTd;
for (i = 14; i >= 0; i--)
BSTd.insert(i);
cout<<<"-- input with repeating elements\n";
BSTree BSTr;
for (i = 0; i < 15; i++)
BSTr.insert(r[i]);
cout<<<"-- big input\n";
BSTree BSTbig;
for (i = 0; i < 120; i++)
BSTbig.insert(rand()%999);
cout<