Given two vectors v1 and v2, we can swap the contents of the two vectors manually using a O(N + M) time algorithm where N = v1.size() and M = v2.size().
However the vector class provides an inbuilt function swap().
What is the time complexity of v1.swap(v2) ?
O(N)
O(1)
O(M)
O(N + M)