rendered paste body#include <iostream>
#include <ostream>
#include <fstream>
#include "BinarySearchTree.h"
using namespace std;
void printMenu();
int main()
{
char choice = 0;
string filename;
cout << " Binary Search Tree Balancing and Drawing " << endl;
BinarySearchTree *root = new BinarySearchTree();
while(choice != '5')
{
printMenu();
cout << endl << "Choice ? ";
cin >> choice;
switch(choice)
{
case '1' : cout << "Please enter name of data file" << endl;
cin >> filename;
/*ifstream infile;
infile.open(filename.c_str());
int k;
infile >> k;
while(infile >> k)
{
root->insert(k,root,0);
}
int count = 0;
root->inorder(root,count);*/
break;
case '2' : root->display(tree);
break;
case '3' : cout << "3" << endl;
break;
case '4' : cout << "4" << endl;
break;
case '5' : return 0;
}
}
/*int count = 0;
root->inorder(root,count);
root->display(root);*/
return 0;
}
void printMenu()
{
cout << "\n\n\t\tMenu " << endl;
cout << " 1. Create new binary search tree " << endl;
cout << " 2. Draw tree " << endl;
cout << " 3. Balance tree" << endl;
cout << " 4. Save tree" << endl;
cout << " 5. Quit" <<endl;
}