Question: In C++ implement insert() in the following code and show the results of inserting 2, 1, 4, 5, 9, 3, 6, 7, 10, 12, 11

In C++ implement insert() in the following code and show the results of inserting 2, 1, 4, 5, 9, 3, 6, 7, 10, 12, 11 into an empty Binary search tree. Start with this tree and implement delete_node() and delete 4 then delete 9. Using this code with the deleted nodes, implement search() and search 12 then search 4.

In C++ implement insert() in the following code and show the results

I can get the nodes inserted but something is wrong when I delete because it says that 4 is found when it shouldn't after it is deleted.

#include #include using std::cout; using std::endl; class Node { int value; public: Node* left; Node* right; Node* p; // left child // right child // parent Node (int data) { value = data; left = NULL; = NULL; right = NULL; ~Node () { int d() { return value; void print() { std::cout

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!