Q8. Vector STL#8 A student just learned about vectors

why not O(1) in average case
how option 3.

Hey On average the time complexity will be O(1) and for a single case it will be O(n) that is when my current size reaches the capacity that is 1000 and then for that case the time complexity will be O(n) and then it will be again O(1).

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.