title: how to find the maximum and minimum in an array using structures and recursion in C
body: <p>I have the following functions that find the maximum and minimum in a matrix, how can I add a structure with min and max to be able to do only a function that finds  minimum and maximum ?</p>
  
  <pre><code>int maximum(int array[], int index, int len) 
  {
      int max;
  
      if(index &gt;= len-2)
      {
          if(array[index] &gt; array[index + 1])
              return array[index];
          else
              return array[index + 1];
      }
  
  
  
  
      max = maximum(array, index + 1, len);
  
      if(array[index] &gt; max)
          return array[index];
      else
          return max;
  }
  
  int minimum(int array[], int index, int len)
  {
      int min;
  
      if(index &gt;= len-2)
      {
          if(array[index] &lt; array[index + 1])
              return array[index];
          else
              return array[index + 1];
      }
  
      min = minimum(array, index + 1, len);
  
      if(array[index] &lt; min)
          return array[index];
      else
          return min;
  }
  </code></pre>