USING C++, Implement a TEMPLATED Binary Search Tree (BST) (RECURSIVE OPERATIONS REQUIRED) class called intBst, which stores integers. Provide the following recursive operations: Insert, Delete tree, Search, inOrder traversal, preOrder traversal, postOrder traversal. Would Delete tree be public or private? Methods that are essential for the correct operation of the tree in terms of managing memory must be provided. Any additional methods can be added. Your Bst.h file for this exercise will now have: template class Bst{… /// declaration of methods and data members of class Bst with doxygen comments }; // rest of the code in Bst.h with normal (non-doxygen) code comments As this is a template class, there is no Bst.cpp. As Node stores the data, Node will also be implemented as a template. Test your template BST with an integer data file. Change the declaration in your test program (main) to: Bst intTree; // rest of the code The data file will contain non-sorted dates in the format: dd/mm/yyyy. Create a date class with the require methods (include variables for day, month,year). This new data file, date.txt, will have dates that are not in any order. Check that your tree works,.
USING C++, Implement a TEMPLATED Binary Search Tree (BST) (RECURSIVE OPERATIONS REQUIRED) class called intBst, which stores integers. Provide the following recursive operations: Insert, Delete tree, Search, inOrder traversal, preOrder traversal, postOrder traversal. Would Delete tree be public or private? Methods that are essential for the correct operation of the tree in terms of managing memory must be provided. Any additional methods can be added.
Your Bst.h file for this exercise will now have:
template <class T>
class Bst{…
/// declaration of methods and data members of class Bst with doxygen comments
};
// rest of the code in Bst.h with normal (non-doxygen) code comments
As this is a template class, there is no Bst.cpp.
As Node stores the data, Node will also be implemented as a template.
Test your template BST with an integer data file. Change the declaration in your test program (main) to:
Bst<int> intTree;
// rest of the code
The data file will contain non-sorted dates in the format: dd/mm/yyyy. Create a date class with the require methods (include variables for day, month,year). This new data file, date.txt, will have dates that are not in any order. Check that your tree works,.
Step by step
Solved in 3 steps with 1 images