title: how to use binary search in two dimensional array?
body: <p>I want to compare 2, two dimensional arrays (some specific element)  <code>arr1[][]</code>,<code>arr[][]</code> in  C++ ,I'm using a for loop to compare them but it took a long time.</p>
  
  <p>Can I use a searching algorithm to implement this like binary search or quick? How can I implement this?</p>
  
  <p>This is my code so far:</p>
  
  <pre><code>for (k = 0; k &lt; MAXROW; k++)
  {  
    for (m = 0; m &lt;  MAXROW; m++)
     {
       for(j=0;j&lt;MAXCOL;j++)
       {
          if(arr[k][3] ==arr1[m][3]) 
          {
            if((arr[k][1] ==arr1[m][1] &amp;&amp; arr[k][2] ==arr1[m][2]))
            {
               cout&lt;&lt;" \n same element";
            }
            else
               cout&lt;&lt;"\n inner  different elements";
          }
          else
             cout&lt;&lt;"\n different elements";
  </code></pre>