Can you tell me what part of my code is wrong

what you have done in code??
it is not seem to be a segment Tree implementation code

segment Tree is implemented using array

I know, it was a binary tree implementation, I had a doubt but it was cleared in the WhatsApp group. Can you tell me where to post doubts which is not related to the topic, or you can say like a general doubt.

the problem in which you are stuck while solving you can tag that but mention your doubts properly

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.