I have checked my code and tested still it is not all testcase.
please help me out. link for code : https://ide.codingblocks.com/s/206628
Wrong answer verdict
@Debugger i think it might be because of the way you are taking input, why are you sorting the array and then making the tree? the first input is supposed to be the root node. but you’ve completely changed the order of the input.
i have removed sort function…but still it is not passing 
@Debugger your code is incorrect for deletion of node with 2 children. You were supposed to swap values, but all you have done is changed the value of target node. You have not changed the value of the leaf node you are actually planning to delete now. do a dry run for any case with 2 children and some grandchildren and you will realise your mistake