Not to useable interface in any real application. No application want your class interact directly with the user. Your class should represent a Tree, should provide methods to work with the tree, should be fully independend from the input method. If I take this class and want to fill it from the file - I fail, If I want to provide some GUI for user convinience - I fail, this class is unusable.Code:void insert(); void remove(); void display();
You should remove all connection to <iostream> from your class
strange sequence of commandsCode:return 0; --num_in_tree;
don't you get warning that not all paths in the BST::remove(int oldElement, node *& troot)
return values?
And why not to make it a little more generic making it a template replacing
int element;
by
T element;?