Let us create following BST 50 / \ 30 70 / \ / \ 20 40 60 80
root = insert ( root , 50 ) ; root = insert ( root , 30 ) ; root = insert ( root , 20 ) ; root = insert ( root , 40 ) ; root = insert ( root , 70 ) ; root = insert ( root , 60 ) ; root = insert ( root , 80 ) ; document . write ( " " ) ; inorder ( root ) ; root = changeKey ( root , 40 , 10 ) ;