title: Quicksort an array in C
body: <p>I'm trying to sort an array of 10 integers using Quicksort algorithm, this below is my code, it doesn't sort properly, can someone please points me to the possible mistakes i'm doing ?</p>
  
  <pre><code>int partition(int arr[], int first, int last)
  {
      int pivot = arr[first];
      int low = first;
      int i = first + 1;
      while(i &lt;= last){
          if(arr[i] &lt; pivot){
              low++;
              swap(&amp;arr[i], &amp;arr[low]);
          }
          i++;
      }
      swap(&amp;arr[first], &amp;arr[low]);
      return low;
  }
  
  void quick_sort(int arr[], int first, int last)
  {
      int pivot_pos;
      if(first &lt; last){
          pivot_pos = partition(arr, first, last);
          quick_sort(arr, first, pivot_pos-1);
          quick_sort(arr, pivot_pos+1, last);
      }
  }
  </code></pre>