title: divide and conquer approach with merge sort
body: <p><b>please could someone help me it returns an array filled in with 0s and that nervous me
  why it returns an array with 0s values ???  </b></p>
  <pre><code>    #include &lt;iostream&gt;
      #include &lt;unistd.h&gt;
      #include &lt;limits&gt;
      #include &lt;cmath&gt;
      using namespace std ;
      // devide-and-conquer approach.........
     // this is the method that sort the array
      void merge(int array[], const int p , const int q, const int r)
      {
              int n1 = q - p + 1 , j{0} , e{0} , k{0};
              int n2 = r - q ;
              double L[n1],R[n2];
      
              for(int i = 0 ; i&lt;n1 ; i++)
                  L[i] = array[p+i];
      
              for(int i = 0 ; i&lt;n2 ; i++)
                  R[i] = array[q + i + 1 ] ;
      
              for(k=0 ; k &lt;= r ; k++)
              {
                  if(e &lt; n1 &amp;&amp; j &lt; n2 &amp;&amp; L[e] &lt; R[j])
                      array[k] = L[e++];
                  else if(e &lt; n1 &amp;&amp; j &lt; n2 &amp;&amp; L[e] &gt; R[j])
                      array[k] = R[j++];
                  else if(e &gt;= n1)
                  {
                      array[k] = R[j++];
                  }
                  else
                  {
                      array[k] = L[e++];
                  }
              }
      
      }
      
      
  </code></pre>
  <p>// the recursion function that devide my array into parts</p>
  <pre><code>    void Merge_Sort(int* arr,const int p , const int r)
      {
          
      
          if(p &lt; r)
          {
      
              int q = (r + p)/2 ;
              Merge_Sort(arr,p,q);
              Merge_Sort(arr,q+1,r);
              merge(arr,p,q,r);
          }
          return;
      }
      
      
  </code></pre>
  <p>just the main function to test if my sort function works well</p>
  <pre><code>int main(int argc,char* argv[])
      {
          int a[10] = {5,2,7,9,2,33,8,6,10,4};
          Merge_Sort(a,0,9);
          
          for(int i = 0 ; i &lt;10 ; i++)
              printf(&quot;%.1f\t&quot;,a[i]);
          cout&lt;&lt;endl;
          return EXIT_SUCCESS ;
      }
  </code></pre>
  <p>thanks at advance</p>