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(2node+1, mid+1, end);
tree[node] = tree[2node] + tree[2node+1];
}
}