All Test cases getting failed. Please check the code.
Code Link: https://ide.codingblocks.com/s/320074.
Thanks in advance.
Delete node in BST
@naivecoder010
You are building the tree wrong. You are not supposed to sort the array and then build the bst. You are expected to insert nodes in the bst in the order they come enter the array. It means in the sample example given, 5 will be set to be the root of the tree.
Please revert if you face any difficulty.
If my solution is able to answer your query, please mark the doubt as resolved.
Thanks for explanation @LP18Aug0068 but still not getting correct output.
Code Link: https://ide.codingblocks.com/s/320074. Okay a small mistake. Done.
No sorting array was wrong.