Given a Binary Tree of size N, your task is to complete the function deletionBT(), that should delete a given node from the tree by making sure that tree shrinks from the bottom (the deleted node is replaced by bottommost and rightmost node).
You don't have to take input. Complete the function deletionBT() that takes root node of the tree and given node value (Key) as input parameter and return the root of the modified tree.
Key=1 1 / \ 4 7 / \ 5 6
5 4 6 7 Explanation:Modified Tree after deletion the
node with key = 1
6 / \ 4 7
The Inorder traversal of the modified
tree is 5 4 6 7