Can someone explain me how do I execute sum query from Index 0 to Index I given the binary value of that Index I. There are some trivial question that I want to know :Do we have to remove last set bit and all the bits following it. How many times do I have to access the temporary array made for the data structure i.e Fenwicktree[ ] array. I have been trying to think about these from the binary index of the Index I. For eg I have the binary 001100100100100011I removed the last set bit. I took 0 as left and 1 as right and traverse it . Whenever I take a right , I access the tree elements and accessing the array finally when I reach the node.So the count comes around  around 6 times. But when I did the same with 1000110111011101100The answer comes out to be 10 but the the number of times I access the array is 12. How do I get to this ? What am I missing out ? Is there a general way to calculate the number of times just looking at the binary value of Index ? Please help me out. 
Fenwick Tree Traversal using Binary value of Index
trees;binary trees;strings;arithmetic