c++) using the following code modify by completing the followingobjectives to finish the implementation.(I.e. see recursive heightis there, just the implementation of else statement needs to befinished and so on for most of the obj).
in Binary_tree.h
- Implement operator=() by using pointer swapping technique.
- Implement the following member functions by usingrecursion
- ~Binary_tree():
- recursive_preorder()
- recursive_inorder()
- recursive_postorder()
- recursive_height()
- Add the following public member function
int getLeafCount()
in Search_tree.h
- Implement search_and_insert()
- Implement search_and_delete() with immediate predecessorapproach
//Binary_node.h
enum Balance_factor { left_higher, equal_height, right_higher};
template
struct Binary_node{
// data members:
Entry data;
Binary_node *left;
Binary_node *right;
// constructors:
Binary_node();
Binary_node(const Entry &x);
};
template
Binary_node::Binary_node(){
left = NULL;
right = NULL;
}
template
Binary_node::Binary_node(const Entry &x){
data = x;
left = NULL;
right = NULL;
}
——————————
//Binary_tree.h
template
class Binary_tree {
public:
Binary_tree();
bool empty() const;
void preorder(void (*visit)(Entry &));
void inorder(void (*visit)(Entry &));
void postorder(void