In the updateNode function in point update of segment tree,
we also need to check if ( i==ss ) i.e if the update Index is matching with the node’s index , because there will be at least two cases where ss is equal to se in the updateNode function. Eg. if we need to update the index 3 then we may reach a node whose range is from 3 to 4, now after this we are calling the updateNode on the left and right.In both the calls ss is equal to se and thus both the index gets updated, which is not desirable. So we need to change the if condition to if( ss==se && i==ss ){ … }
updateNode function
hello @officialsoumalya
yeah that condition is necessary .
or u can call only one side of node with the help of index(we want to update)
something like

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.