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,.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter17: Linked Lists
Section: Chapter Questions
Problem 5PE
icon
Related questions
Question

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,.

 

Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Types of trees
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning