Page 1 of 1

1- struct Node { int data; struct node* left; struct node* right; 5 }; 6 int operatorl(Node root) 8 19 Node current - ro

Posted: Mon Jun 06, 2022 1:13 pm
by answerhappygod
1 Struct Node Int Data Struct Node Left Struct Node Right 5 6 Int Operatorl Node Root 8 19 Node Current Ro 1
1 Struct Node Int Data Struct Node Left Struct Node Right 5 6 Int Operatorl Node Root 8 19 Node Current Ro 1 (428.91 KiB) Viewed 46 times
1- struct Node { int data; struct node* left; struct node* right; 5 }; 6 int operatorl(Node root) 8 19 Node current - root 10 while (current->right !- NULL) 11 current - current->right; 12 13 return (current->data); 15 } 16 int operator2(Node* root) 18 19 20 void operator3(Node* root) 21- { L234 if (root-left NULL && root->right TONGLOME operator3(root->left); operator3(root->right); 24 25 } 26- else { delete root; } The question is given below. Question: Above is the partial implementation for the Binary Search Tree (BST) operations. 1. Explain what operator serves for in a single sentence. 2. Write the C+ code for operator? whose goal is to find the minimum data in a BST. 3 The operator3 function is supposed to delete all the leaves in a BST. Correct the bugs in the code. Do not re-write the function just state how you want to correct the mistakes in the code in a single sentence. 22222789 23 29 } L NULL) {