title: Split an array in half and find the two Max values and then merge the two values
body: <p>I'm taking an online class so there isn't any help from the teachers or other classmates. Our assignment is that we need to find the max value and index of an array of random numbers. We need to do it in two ways. A regualr loop(brute force) and divide and conquer. In the divide and conquer we need to split the array into two smaller arrays and find the max of both and then merge. </p>
  
  <p>I got the brute force to work and I got the divide and conqure to find the max also. But I can't seem to get the max of the two smaller arrays and merge the two. We also need to check for how many comparison is made by both methods and print the output. </p>
  
  <p>Here's what I have so far:</p>
  
  <pre><code>  public class MinMaxValues{  
  
  
  
   // Find maxiumum (largest) value in array using Divide and Conquer
  
  
   public static int findMax( int[]numbers, int left, int right )
   {
   int middle;
   int max_l, max_r, max_m;
  
   if ( left == right )    // Only one element...
   {  
      // Base case: solved easily...
  
      return numbers[left];
   }
   else
   {
  
      // Solve smaller problems
  
      middle = (left+right)/2;   // Divide into 2 halves
  
      max_l = findMax( numbers, left, middle);  
                 // Find max in first half 
  
      max_r = findMax( numbers, middle+1, right);  
                 // Find max in second half
        //System.out.println("Maximum Value = " + max_r);   
      max_m = max_l+ max_r;
  
      // Use the solutions to solve original problem
  
      if ( max_l &gt; max_r )
         return(max_l);
      else
         return(max_r);
            //return(max_m);
  
    }
    }
    }
  </code></pre>