How to solve this one?

Find the starting index of segment tree using this build function :

void build(int node, int start, int end) {

if(start == end)
{
tree[node] = A[start];
}
else
{
int mid = (start + end) / 2;
build(2node, start, mid);
build(2
node+1, mid+1, end);
tree[node] = tree[2node] + tree[2node+1];
}
}

 tree[node] = tree[2*node] + tree[2*node+1];

this line will tell
the start point
see if we take start as 0
then 2node = 0
and 2 * node +1 == 1
so that would suffice the condition of nodes being at 2
node &2*node+1

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.