Please check why my code is giving wrong output


please correct the link and send the corrected link and solve the problem

@harryson when you run that code it is telling you that your non-void function reaches the end without returning anything. You can easily rectify the error by checking if all the cases in the multiple if-else scenarios are returning something or not.
Add return root; in line 87, and this code will work.
I have made the changes here https://ide.codingblocks.com/s/211984

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.