Can this question be solved using square root decomposition??
Min Query-1 doubt
This is a typical and basic segment tree problem.
How do you feel to do it with SRD? Try implementing that
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.
Since updates can not be performed in O(1) , this is not a good technique to go with. You cannot compute minimum of a block after updating an index in O(1) you have to spend O(rootn) time to do that. That makes update a O(rootn) per query.
If updates are not to be done then you can go with this.