Ques 3 vector STL3

Is it not of o(n) complexity?

hi @dakshi

yes it is O(n)

its right answer is given o(n2)
plz correct it

There is an issue with quizzes right now that we are trying to fix. Sorry for the inconvenience caused.

Unless there is anything else I can help you with kindly mark this query as resolved.

i think a little bit more
it should be o(n^2)

because vector is pass by value
so every time vector will be copied
hence time complexity should be O(n^2)

if it is pass by refrence then sure it is O(n)

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.