Recursion calls will be for n times, how the answer is N^2? Is it because of the sum statement??
How N^2 is correct?
Hey,we are not passing vector as refrence so it getting copied in each function call.So O(n) additional work for each call.Hence,N^2
ok thanks for the explanation.
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.