Let us create following BST 12 ( 3 ) / \ 10 ( 2 ) 20 ( 1 ) / \ 9 ( 1 ) 11 ( 1 )
node root = null ; root = insert ( root , 12 ) ; root = insert ( root , 10 ) ; root = insert ( root , 20 ) ; root = insert ( root , 9 ) ; root = insert ( root , 11 ) ; root = insert ( root , 10 ) ; root = insert ( root , 12 ) ; root = insert ( root , 12 ) ; Console . Write ( " Inorder ▁ traversal ▁ of ▁ " + " the ▁ given ▁ tree ▁ " + " STRNEWLINE " ) ; inorder ( root ) ; Console . Write ( " STRNEWLINE Delete ▁ 20 STRNEWLINE " ) ; root = deleteNode ( root , 20 ) ; Console . Write ( " Inorder ▁ traversal ▁ of ▁ " + " the ▁ modified ▁ tree ▁ STRNEWLINE " ) ; inorder ( root ) ; Console . Write ( " STRNEWLINE Delete ▁ 12 STRNEWLINE " ) ; root = deleteNode ( root , 12 ) ; Console . Write ( " Inorder ▁ traversal ▁ of ▁ " + " the ▁ modified ▁ tree ▁ STRNEWLINE " ) ; inorder ( root ) ; Console . Write ( " STRNEWLINE Delete ▁ 9 STRNEWLINE " ) ; root = deleteNode ( root , 9 ) ; Console . Write ( " Inorder ▁ traversal ▁ of ▁ " + " the ▁ modified ▁ tree ▁ STRNEWLINE " ) ; inorder ( root ) ; } }