Maximum in column of 2d array using divide and conquer
<p>Let's assume we have an 2d array </p>

<pre><code>1   2    3   1
5   6    4   0
0   3    2   1 
1   2    1   0
</code></pre>

<p>Is there a global way how to find a max number in column using divide and conquer technique if the length of the row wasn't same for every row?</p>

<p>I am referring to a step in finding a peak inside 2d array that requires this step.</p>

<p>On 1d array it would be something like</p>

<pre><code>int maxNumber( vector&lt;int&gt; a , int min , int max ){
    if( min == max )
        return a[min];
    int mid = ( min + max)/2;
    int i   = maxNumber( a , min , mid );
    int j   = maxNumber( a , mid +1, max);
    if( i &gt; j)
        return i;
    return j;
    } 

   vector&lt;int&gt; v = { 1 , 2 , 5 , 0 , 10 , 9};
   cout &lt;&lt; maxNumber( a , 0 , a.size() -1 );
</code></pre>

<p>Now for NxN or NxM matrix we could do </p>

<pre><code>int maxNumberCollum( vector&lt;vector&lt;int&gt;&gt; a , int row_min , int row_max , int size){
    if ( row_min == row_max ){
        return a[row_min][size];
    }

    int row = ( row_min + row_max ) / 2;
    int i   = maxNumberCollum( a , row_min , row     , size );
    int j   = maxNumberCollum( a , row + 1 , row_max , size);

    if( i &gt; j)
        return i;
    return j;
};

 vector&lt; vector&lt;int&gt; &gt; a = { { 1 , 2 , 3 },
                             { 5 , 0 , 1 },
                             { 6 , 2 , 0 }
                           };
cout &lt;&lt; maxNumberCollum( a , 0 , a.size() -1 , 2 )
</code></pre>

<p>with column we want to find maximum in passed as argument.</p>

<p>But what would be effective way how to implement it to 2d array given the fact that we do not know if the matrix (2d array ) is NxN / NxM or the length of row isn't same for every row?</p>