Selection_sort doubt

can we use swap function in placement exams?
what’s the complexity of swap function?

hey @aceash98, this function is present in iostream.h only, so if you are asked not to use any external header file, you can still use.

Time complexity is constant for this function.

here its defination
template void swap ( T& a, T& b )
{
T c(a); a=b; b=c;
}