Implement the sort method of the merge sort algorithm without recursion, where the length of the array is a power of 2. First merge adjacent regions of size 1, then adjacent regions of size 2, then adjacent regions of size 4, and so on.

Complete the following file:

MergeSorter.java

Use the following file:

MergeSorterTester.java

import java.util.Arrays;

/**
   This program tests the non-recursive merge sort algorithm.
*/
public class MergeSorterTester
{  
   public static void main(String[] args)
   {  
      int[] a = new int[16];
      for (int i = 0; i < 16; i++) a[i] = 100 - (8 - i)*(8 - i);
      MergeSorter sorter = new MergeSorter(a);
      sorter.sort();      
      System.out.println(Arrays.toString(a));
      System.out.println("Expected: [36, 51, 51, 64, 64, 75, 75, 84, 84, 91, 91, 96, 96, 99, 99, 100]");
   }
}