title: Sorting an array in C?
body: <p>Which is the best sorting technique to sort the following array and if there are duplicates how to handle them:</p>
  
  <pre class="lang-c prettyprint-override"><code>int a= {1,3,6,7,1,2};
  </code></pre>
  
  <p>Also which is the best sorting technique of all?</p>
  
  <pre class="lang-c prettyprint-override"><code>void BubbleSort(int a[], int array_size)
  {
      int i, j, temp;
      for (i = 0; i &lt; (array_size - 1); ++i)
      {
          for (j = 0; j &lt; array_size - 1 - i; ++j )
          {
              if (a[j] &gt; a[j+1])
              {
                  temp = a[j+1];
                  a[j+1] = a[j];
                  a[j] = temp;
              }
          }
      }
  }
  </code></pre>