what is time complexity of swap function

Solutions on MaxInterview for what is time complexity of swap function by the best coders in the world

showing results for - "what is time complexity of swap function"
Ilias
13 Apr 2018
1The Behaviour is Equivalent to: 
2
3template <class T> void swap ( T& a, T& b )
4{
5  T c(a); a=b; b=c;
6}
7
8Syntax : Swap(a,b) // a = Number 1 , b = Number 2
9
10Time Complexity: It makes one constructions and one assignments
11				 So, Linear O(n) time.