node
do I also have to create destructor for binary_tree
to delete root
?
|
|
|
|
If I have created destructor for node do I also have to create destructor for binary_tree to delete root |
In case I have to create it what I think I should do, would it recursively delete all the nodes in the tree or I have to travel the tree to delete every node? |
binary_tree::~binary_tree() { delete root; }
should be sufficient.