I googled for 3D Fenwick Tree to get update and range code and coded it here. But it does not give correct answer.
Please tell me where is the mistake in the code.
If i am missing some logic please explain what am i missing.
Code link: https://ide.codingblocks.com/s/113488
Counting In Byteland - Mistake in Code
this is my simple template for 3d fenwick tree
Solved, i didn’t need to subtract queried values in update rule.
Can you give a explanation to range query.