Driver program to test above functions
let arr = [ 3 , 2 , 0 , 1 ] ; let n = arr . length ; document . write ( " " ) ; printArr ( arr , n ) ; rearrange ( arr , n ) ; document . write ( " " ) ; printArr ( arr , n ) ;