void swap(int *px, int *py)
{
int temp = *px;
*px = *py;
*py = temp;
}
void swap(int &x, int &y)
{
int temp = x;
x = y;
y = temp;
}
template<class T>
void swap(T& x, T& y)
{
T temp = x;
x = y;
y = temp;
}