Vector stl quiz

nt sum = 0;
void calcSum(vector v, int i)
{
if(i == v.size())
return;
sum += v[i];
calcSum(v, i+1);
}

what is the complexity and how ?

The answer must be O(n). If some other answer is marked then dont worry about it.There is an issue with quizzes right now that we are trying to fix. Sorry for the inconvenience caused.

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.