BST
BST
BST.cpp
Michael Rose
002994588
Final Exam take home portion added.
Added definitions of findLevel() and balancedBST() to the file
*/
#include <iostream>
#include <iomanip>
#include "BST.h"
//recursively call the function to insert on the left side and the right side
insert(balancedBST(arr, start, mid -1));
insert(balancedBST(arr, mid+1, end));
return arr[mid];
}
void BST::preOrder() {
if (myRoot == 0)
cout << "BST is empty" << endl;
else
myRoot->preorder();
}
int BST::nodeCount() {
if (myRoot == 0)
{
cout << "BST is empty" << endl;
return 0;
}
else
return myRoot->nodeCount();
}