Problem in understanding 2D BIT

Revision en1, by ankit_gupta_, 2018-07-19 11:28:43

Please help me with some doubts, I was reading 2D BIT, gfg implementation https://www.geeksforgeeks.org/two-dimensional-binary-indexed-tree-or-fenwick-tree/

In the updateBit and getSum function inner loop, "y" is not initialized again, can someone explain me how is it working and what is the need of outer loop as the same work can be done with the help of an "if" statement.

Thanks in advance..

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English ankit_gupta_ 2018-07-19 11:28:43 434 Initial revision (published)