swap(a, i, j)

Swaps entries i and j of array a.


See also reverse sort 


Example


a = ( 2, 4, 6, 8, 10 )

2  4  6  8  10

swap( a, 2, 5 )

2  10  6  8  4