other halfand how the ranges grow larger and larger the mergesort java program in moment we'll look at the entire mergesort java program firstlet' focus on the method that carries out the mergesort here it isprivate void recmergesort(double[workspaceint lowerboundint upperboundif(lowerbound =upperbound/if range is return/no use sorting else /find midpoint int mid (lowerbound+upperbound /sort low half recmergesort(workspacelowerboundmid)/sort high half recmergesort(workspacemid+ upperbound)/merge them merge(workspacelowerboundmid+ upperbound)/end else /end recmergesort as you can seebeside the base casethere are only four statements in this method one computes the midpointthere are two recursive calls to recmergesort((one for each half of the array)and finally call to merge(to merge the two sorted halves the base case occurs when the range contains only one element (lowerbound==upperboundand results in an immediate return in the mergesort java programthe mergesort(method is the one actually seen by the class user it creates the array workspace[]and then calls the recursive routine recmergesort(to carry out the sort the creation of the workspace array is handled in mergesort(because doing it in recmergesort(would cause the array to be created anew with each recursive callan inefficiency the merge(method in the previous merge java program operated on three separate arraystwo source arrays and destination array the merge(routine in the mergesort java program operates on single arraythe thearray member of the darray class the arguments to this merge(method are the starting point of the lowhalf subarraythe starting point of the high-half subarrayand the upper bound of the high-half subarray the method calculates the sizes of the subarrays based on this information listing shows the complete mergesort java program this program uses variant of the array classes from adding the mergesort(and recmergesort(methods to the darray class the main(routine creates an arrayinserts itemsdisplays the arraysorts the items with mergesort()and displays the array again listing the mergesort java program /mergesort java /demonstrates recursive mergesort