title: Recursively Merge And Sort A List
body: <p>I'm trying to make a recursive merge and sort function and I've spent a few hours on it but I just get frazzled. I've looked at several resources, and I have the answers, but I'm trying to understand, not just copy paste. Also this is homework and it seems like that would be cheating. </p>
  
  <p>I was hoping that someone could try and give me a little direction on where to go next. I've coded a function that recursively breaks the list into individual parts. The merging and sorting is really throwing me off though.</p>
  
  <pre><code>import java.util.*;
  import java.util.Random;
  public class TheEngine {
  
      private static List&lt;Integer&gt; test = new ArrayList&lt;&gt;();
  
  
      public static void main(String[] args) {
  
          Random rand = new Random();
  
          for(int i = 0; i &lt; 12; i++) {
              test.add(rand.nextInt(100));
          }
          System.out.println(test);
          System.out.println(test.size());
          splitter(test);
      }
  
  
      public static List&lt;Integer&gt; splitter(List&lt;Integer&gt; list){
  
  
  
          int mid = list.size() / 2;
  
          if(list.size() == 1) {
              System.out.println(list);
          }
          else if(list.size() % 2 == 0) {
              //TODO: EVEN
              splitter(list.subList(0, mid));
              splitter(list.subList(mid, list.size()));
          }
          else if(list.size() % 2 == 1) {
              //TODO: ODD
              splitter(list.subList(0, mid));
              splitter(list.subList(mid, list.size()));
          }
  
          return list;
      }
  
  
  }
  </code></pre>