title: Write an algorithm in C of cost O(log(n)) with divide and conquer approach
body: <p>I have to write a function in C which takes as input an array and the dimension of the array.
  We assume that the array has the following characteristics:</p>
  <ol>
  <li>Every element in the array is different</li>
  <li>the first elements of the array are odd and the remaining are even</li>
  <li>There are at least one odd element and one even element in the array</li>
  </ol>
  <p>The function has to return the first index of the even elements using a divide and conquer approach and the cost of the algorithm should be O(log(n)).</p>
  <p>In a normal case, I would use a function like this:</p>
  <pre><code>int foo(int v[], int n){
     for(int i=0; i&lt;n; i++){
      if(v[i]%2==0)
         return i; 
     }
  }
  </code></pre>
  <p>But I have no idea how to solve this problem with the divide and conquer approach.
  Is it possible to solve the problem using a modified version of the mergesort o quicksort algorithm?</p>