original array is broken in two parts left and right array
int len1 = m - l + 1 , len2 = r - m ; int [ ] left = new int [ len1 ] ; int [ ] right = new int [ len2 ] ; for ( int x = 0 ; x < len1 ; x ++ ) left [ x ] = arr [ l + x ] ; for ( int x = 0 ; x < len2 ; x ++ ) right [ x ] = arr [ m + 1 + x ] ; int i = 0 ; int j = 0 ; int k = l ;