Driver program to test above function
public static void Main ( ) { int [ ] arr = { 1 , 8 , 3 , 9 , 10 , 10 , 2 , 4 } ; int n = arr . Length ; cycleSort ( arr , n ) ; Console . Write ( " After ▁ sort ▁ : ▁ " ) ; for ( int i = 0 ; i < n ; i ++ ) Console . Write ( arr [ i ] + " ▁ " ) ; } }