Swap positions of two elements.