Driver Code
let arr = [ 10 , 30 , 20 , 40 , 50 , 60 , 70 ] ; let n = arr . length ; document . write ( " " + " " ) ; printArray ( arr , n ) ; sortByOneSwap ( arr , n ) ; document . write ( " " + " " ) ; printArray ( arr , n ) ;