Question generated for student with ID 0341340
(You are responsible to check if your student number is correct!)
Read carefully the binary tree implementation given in class. Using that given tree structure to dothe following problems:
- Write a function to build a binary tree from a given array of int.
- Write a function to delete the root node of a tree and replace with the right-most leaf node. (Hint. Write another function to delete the right-most leaf node first!)
- Write a function to delete duplicate entries from a binary tree
- Write a function to calculate the sum of all the leaf nodes of a given binary tree.
- Write a function to delete the maximum value of a binary tree.
You must also write a main function with other sufficient function calls to Insert() and Print() and several test cases to make sure your program performs properly! Each program should be in a seperate file with meaningfulcomments for your code. You may re-use as much code as needed for each part.