into itself you may wonder where all these subarrays are located in memory in the algorithma workspace array of the same size as the original array is created the subarrays are stored in sections of the workspace array this means that subarrays in the original array are copied to appropriate places in the workspace array after each mergethe workspace array is copied back into the original array the mergesort workshop applet all this is easier to appreciate when you see it happening before your very eyes start up the mergesort workshop applet repeatedly pressing the step button will execute mergesort step by step figure shows what it looks like after the first three presses figure the mergesort workshop applet the lower and upper arrows show the range currently being considered by the algorithmand the mid arrow shows the middle part of the range the range starts as the entire array and then is halved each time the mergesort(method calls itself when the range is one elementmergesort(returns immediatelythat' the base case otherwisethe two subarrays are merged the applet provides messagessuch as entering mergesort - to tell you what it' doing and the range it' operating on many steps involve the mergesort(method calling itself or returning comparisons and copies are performed only during the merge processwhen you'll see messages such as merged - and - into workspace you can' see the merge happeningbecause the workspace isn' shown howeveryou can see the result when the appropriate section of the workspace is copied back into the original (visiblearraythe bars in the specified range will appear in sorted order firstthe first bars will be sortedthen the first barsthen the bars in the range - then the bars in the range - then the bars in the range - and so oncorresponding to the sequence shown in figure eventually all the bars will be sorted you can cause the algorithm to run continuously by pressing the run button you can stop this process at any time by pressing stepsingle-step as many times as you wantand resume running by pressing run again as in the other sorting workshop appletspressing new resets the array with new group of unsorted bars and toggles between random and inverse arrangements the size button toggles between bars and bars it' especially instructive to watch the algorithm run with inversely sorted bars the