Question: In c 1. Implement a recursive function RecursiveInsertBinarysearchTree ) for inserting elements into a binary search tree. Write a main program to test your function.
1. Implement a recursive function RecursiveInsertBinarysearchTree ) for inserting elements into a binary search tree. Write a main program to test your function. You may use the following declaration for your binary tree: typedef struct TreeNode "Tree: struct TreeNode int val. Tree left: Tree right: Tree RecursiveinsertBinarysearchTros (int x, Tres t) if (t NULL) t Create and return a one-node tree / t = (Tree) malloasizeof (struct tree-node)); if (t NULL) Eatal ezEor("Out of space!t!) else t->left t->right NULL; = else if (xval) t->left RecursivelnaertBinarySearchTree (x, = t->left); else if (x>t->val) t->right return t:/ Don't forget this line!! / RecuraiveinsertBinarysearchTree (x, tright) / else x is in the tree already. No'11 do nothing/ 2. Implement an iterative C function IterativeFindMinimum) for finding the 3. Implement an iterative C function IterativeFindMaximum ) for finding the 4. Implement a recursive C function RecuroiveFindMaximum) for finding 5. Implement a recusive C function RecursiveFindMinimum( for finding the 6. Implement a C function callod findELement () th minimum value in a binary search tree, maximum value in a binary search tree. maximum value in a binary search tree. minimum value in a binary search treo. node that Inc des that value the hat takes a value and returns the
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
