Range Update in BIT

Is it possible to update a range in Binary Indexed Tree…??
I want this to solve the http://www.codechef.com/problems/FLIPCOIN problem using Binary Indexed Tree(BIT).

1 Like

http://apps.topcoder.com/forums/?module=Thread&threadID=715842&start=0&mc=8#1406845

I’ve explained range updates with BIT and provided implementation here:
http://kartikkukreja.wordpress.com/2013/12/02/range-updates-with-bit-fenwick-tree/

5 Likes

another goes here…

I have spent many days to understand range update, wrote simple explanation with example here:

Really amazing post!! :smiley: It helped me understanding some things in a pratical way which I’ve only read about! Thanks!

hey …did studied ur post bt could not understand “Why we are not doing :- update(a,v) update(b+1,-v) for the update part and query(b)-query(a-1) for the sum part …whats wrong in that part???”