Driver program to test above function
arr = new Array ( 16 , 17 , 4 , 3 , 5 , 2 ) ; size = arr . length ; nextGreatest ( arr , size ) ; document . write ( " " + " " + " " ) ; printArray ( arr , size ) ;