How can I solve this problem UVA Problem 11297 — Census using Binary Indexed Tree ?
Problem Description in Short : Given a 2D grid (500x500 at most), I need to process 2 types of query.
- Change the value of grid[x][y] by Val
- Output the maximum and minimum number of a sub rectangle of grid (x1,y1) to (x2,y2)
( considering every input is valid ) How can I solve this problem using Binary Indexed Tree? Also it will be a great hand if you help me to understand how Range Minimum or Maximum Query can be done by BIT.
Thanks in Advance :)