I have been trying to get an index of sum range query for the array. Suppose that I have an array like:
{1, 3, 5, 7, 9, 11}
With a segment tree like that
{36, 9, 27, 4, 5, 16, 11, 1, 3, DUMMY, DUMMY, 7, 9, DUMMY, DUMMY}
Here is an image of it.
How can I get the index for the query 0-2 in the segment tree array (for example index for the 0-2 index is 1, for 3-5 it is 2)?