title: Convert Algo to C++
body: <pre class="lang-none prettyprint-override"><code>MAXIMA(int n, Point P[1 . . . n])
  1 for i &lt;-- 1 to n 
  2 do maximal &lt;-- true
  3 for j &lt;-- 1 to n 
  4 do
  5 if (i != j)&amp;(P[i].x &lt;= P[j].x)&amp;(P[i].y &lt;= P[j].y) 
  6 then maximal &lt;-- false break
  7 if maximal
  8 then output P[i].x, P[i].y
  </code></pre>
  
  <p>This is algorithm : basically they gave me points <code>{12, 12},{14, 10},{15, 7},{7, 7},{11, 5},{13, 3},{5, 1},{7, 13},{4,11},{9,10},{2,5},{4,4}</code>
  That the out put will be relate to Row , COL OR X , Y so Maximum of X&amp;Y will be result or can say the point which is not dominated by others in mean of x or y so my code is:</p>
  
  <pre><code>    #include&lt;iostream&gt;
      #include&lt;conio.h&gt;
      using namespace std;
  
      struct Point{
      int x;
      int y;
  
  };
  
  int main()
      {
        Point P[12][2] = {  {12, 12},{14, 10},{15, 7},{7, 7},{11, 5},{13, 3}{5,1},{7, 13},{4,11},{9,10},{2,5},{4,4}    };
  
  
        bool maxim=true;
        for(int i = 0; i &lt; 12; i++)
          for(int j = 0; j &lt; 2; j++) 
            do {
              if(i != j &amp;&amp; P[i].x &lt;= P[j].x &amp;&amp; P[i].y &lt;= P[j].y)  {
                cout &lt;&lt; array[i][j] &lt;&lt;"\t" ;
                cout&lt;&lt;"\n";
                maxim=false;
  
              }
            } while(maxim=true);
            break;
          }
        }
        _getch();
        return 0;
      }
  </code></pre>
  
  <p>My output is not same as it should be Output Should be:</p>
  
  <pre class="lang-none prettyprint-override"><code>(7 13) (12 12) (14 10) (15 7)
  </code></pre>
  
  <p>As you can see in the first point no one dominates 13</p>
  
  <p>2nd (12 , 12)</p>
  
  <p>3rd (14, 10)</p>
  
  <p>4th (15,7)</p>