title: Finding Max value in an array using recursion
body: <p>For one of the questions i was asked to solve, I found the max value of an array using a for loop, so i tried to find it using recursion and this is what I came up with:</p>
  
  <pre><code>public static int findMax(int[] a, int head, int last) {
  
      int max = 0;
      if (head == last) {
          return a[head];
      } else if (a[head] &lt; a[last]) {
          return findMax(a, head + 1, last);
      } else {
          return a[head];
      }
  }
  </code></pre>
  
  <p>So it works fine and gets the max value, but my question is  : is it ok to have for the base case return a[head] and for the case when the value at the head is > the value at last?</p>