Question: Implement insert() in tree.cpp and show the results of inserting 2, 1, 4, 5, 9, 3, 6, 7, 10, 12, 11 into an empty Binary

Implement insert() in tree.cpp and show the results of inserting 2, 1, 4, 5, 9, 3, 6, 7, 10, 12, 11 into an empty Binary search tree. 2.Start with the tree in problem 1 and implement delete_node() and do: 2.1.delete 4, then 2.2.delete 9. 3.Start with the tree in problem 2 and implement search() and do: 3.1.Search 12 3.2.Search 4

#include #include

using std::cout; using std::endl;

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

int main(int argc, const char * argv[]) { }

function insert(Node *insert_node, Node *tree_root){ //Your code here }

function delete_node(int value, Node *tree_root){ //Your code here }

function search(int value, Node *tree_root){ //Your code here }

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!