Delete nodes from bst problem

https://ide.codingblocks.com/s/61565

The code is expected to produce the output which acc to me is not in preorder. so how to rectify it ?

@yuktimutreja01 I modified your code the question is little tricky in third case of delete bst function just replace left instead of right it will work https://ide.codingblocks.com/s/61570