What is the time complexity of v1.swap(v2)?

why O(1) ? why shouldn’t it be sum of both vectors size?

@ashutosh_singh
Here it is written that it takes constant time. It might be just changing names of the vector.
lets say
v1 = {1,2,3,4};
v2 = {1,2};
after swapping =>
v2 = {1,2,3,4}
v1 = {1,2}
so v1 and v2 now points to different vector, without accessing the elements of the vector.
http://www.cplusplus.com/reference/vector/vector/swap/

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.