Here is the code I am not sure what you mean.
my_bst_node.h
//create bst node
#ifndef MY_BST_NODE_H
#define MY_BST_NODE_H
#include <iostream>
using namespace std;
template<class KT,class DT>
class my_bst_node
{
public:
my_bst_node();
my_bst_node(KT tag, DT info, my_bst_node* l=0, my_bst_node* r=0);
KT key;
DT data;
my_bst_node* left;
my_bst_node* right;
};
template<class KT, class DT>
my_bst_node<KT,DT>::my_bst_node()
{
left=right=0;
}
template<class KT, class DT>
my_bst_node<KT,DT>::my_bst_node(KT tag, DT info, my_bst_node* l, my_bst_node* r)
{
key=tag;
data=info;
left=l;
right=r;
}
#endif
my_bst.h
//operations that a bst can perform
#ifndef MY_BST_H
#define MY_BST_H
#include <iostream>
#include "my_bst_node.h"
using namespace std;
template<class KT,class DT>
class my_bst
{
public:
//default constructor
my_bst();
//inserts a new node into binary tree
void insert(KT searchkey, const DT &newDataItem);
//search for the key and if found return true
void search(KT searchkey);
//prints out tree based on visiting the root node, then the left subtree and last the right subtree
void preorder_print();
//prints out tree based on visiting the left subtree, then the root node, and last the right subtree
void inorder_print();
//prints out tree based on visiting the left subtree, then the right subtree, and last the root node
void postorder_print();
//remove data item
void remove(KT searchkey);
//returns height of BST
int height();
//check if tree is balanced
void balanced();
//output tree structure
void show(int tree);
private:
my_bst_node<KT,DT>* root;
//helper function of insert
void insert(my_bst_node<KT,DT>*& newnode ,my_bst_node<KT,DT>*& nodepointer);
//helper function of search
void search(my_bst_node<KT,DT>*& d, const KT& searchkey);
//helper function of preorder print
void preorder_print(my_bst_node<KT,DT>*& f);
//helper function of …