I don't think we need segment tree in this. just the lazy tree is sufficient

I think using only the lazy tree will solve the purpose and there is no need to use the segment tree…

Hi,

The purpose of lazy tree is to reduce the time taken in query and updates in segment tree.So, in this question lazy tree is used to reduce our query and updates time.

I hope I have cleared your doubt.If yes, please mark it as resolved.

bro…please do look what I asked…I said it look’s that we don’t need 2 different trees which were said in hint …

Our purpose can be served by using one tree…

Yes you can do it in one tree but time taken will be more. So, we use two trees:Segment tree and lazy tree.

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.