swap funciton Compleity code example
Example: what is time complexity of swap function
The Behaviour is Equivalent to:
template <class T> void swap ( T& a, T& b )
{
T c(a); a=b; b=c;
}
Syntax : Swap(a,b) // a = Number 1 , b = Number 2
Time Complexity: It makes one constructions and one assignments
So, Linear O(n) time.