Given a Binary Search Tree of size N, your task is to complete the function changeKey() that change old key value present in the tree and changes it to new key value.
Input: Root of below tree
/ \ / \
20 40 60 80
Old key value: 40
New key value: 10
Output: BST should be modified to following
/ / \
20 60 80
The function takes three arguments, reference pointer to the root node of the BST, old key value of the node and a new key value.
There will be T test cases and for each test case the function will be called separately.
For each test case output the Inorder traversal of the Tree.
Note:The Input/Ouput format and Example given are used for system's internal purpose, and should be used by a user for Expected Output only. As it is a function problem, hence a user should not read any input from stdin/console. The task is to complete the function specified, and not to write the full code.