USING C++ Implement a simple (non-templated) Binary Search Tree (BST) 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. You should go through the lecture notes (and the textbook for ideas). Processing a node simply involves printing out the contents of the node, which in this case is the integer stored in the node. Data should come from a data file containing integers. You decide on the format. The main program should open the data file and insert into the tree and demonstrate other tree operations. The point of this exercise is to demonstrate that you understand the BST. There is no need to go overboard with it and put in operations not asked for that you will normally find in the textbook and the reference book, Introduction to Algorithms. class intBst{… //intBST.h /// declaration of methods and data members of class intBst with doxygen comments }; // The implementation can go into intBST.cpp but for convenience only, keep the // rest of the code in intBST.h with normal (non-doxygen) code comments // The integer BST will be changed later to a template BST, and that is the reason // for having everything in inBST.h now – convenience for the changeover to // template BST. To use your BST in your test program, you will have the following declaration in the main program’s routine main(). intBst intTree; // declaration of non-templated integer tree // other code follows the above: // insert various integer values // test the tree methods Make sure that the BST is tested properly. So that would involve passing it to subroutin

icon
Related questions
Question

USING C++ Implement a simple (non-templated) Binary Search Tree (BST) 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. You should go through the lecture notes (and the textbook for ideas).

Processing a node simply involves printing out the contents of the node, which in this case is the integer stored in the node.

Data should come from a data file containing integers. You decide on the format. The main program should open the data file and insert into the tree and demonstrate other tree operations.

The point of this exercise is to demonstrate that you understand the BST. There is no need to go overboard with it and put in operations not asked for that you will normally find in the textbook and the reference book, Introduction to Algorithms.

class intBst{… //intBST.h

/// declaration of methods and data members of class intBst with doxygen

comments };

// The implementation can go into intBST.cpp but for convenience only, keep the

// rest of the code in intBST.h with normal (non-doxygen) code comments

// The integer BST will be changed later to a template BST, and that is the reason

// for having everything in inBST.h now – convenience for the changeover to

// template BST.

To use your BST in your test program, you will have the following declaration in the main program’s routine main().

intBst intTree; // declaration of non-templated integer tree

// other code follows the above:

// insert various integer values

// test the tree methods

Make sure that the BST is tested properly. So that would involve passing it to subroutin

Expert Solution
steps

Step by step

Solved in 3 steps with 2 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, data-structures-and-algorithms and related others by exploring similar questions and additional content below.