Find number of swaps int sorting

how to find the number of swaps in sorting an array
and it should return the count of swaps performed

Refer these