Question: How to create a copy constructor of a binary search tree with the given header file below. Using C++ (not C) with recursive: #ifndef BST_H_
How to create a copy constructor of a binary search tree with the given header file below. Using C++ (not C) with recursive:
#ifndef BST_H_ #define BST_H_ #include
void insertNode(Node* root, bstdata data);
//private helper function for insert //recursively inserts a value into the BS
void copyNode(Node* copy) const; //recursive helper function to the copy constructor
public: BST();
BST(const BST &bst); //copy constructor
void insert(bstdata data);
};
#endif /* BST_H_ */
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
