Segment Tree basic recursion doubt

Why are we returning in every case? For example while building min segment tree

if(s<e)
return;

if(s==e)
{

tree[index]= a[s];

return; // why is this done?

}

@codeku
hello mehul,
we are returning because that is the base case.
image

Got it, thank you :smiley: