sortarr is sorted array of arr
Vector < Integer > sortarr = new Vector < Integer > ( ) ; for ( int i = 0 ; i < arr . size ( ) ; i ++ ) { sortarr . add ( arr . get ( i ) ) ; } Collections . sort ( sortarr ) ;