Delete node in bst

https://ide.codingblocks.com/s/58350 please check my code

this is not resolved
please see output of the code

@sanjeetboora please help me in debug

When a node is to be deleted from the tree which has two children , the best suitable replace for that node is , either the smallest element in the right sub-tree or largest element in left sub-tree . So in this case the 2nd possibility is taken by the question setter . Do according to that.
That is why the final output is 4 7 6 8 ., with 4 as root node.