title: Java sorting with quicksort algorithm
body: <p>I'm trying to code a quicksort program in java.here is my partition function</p>
  
  <pre><code>int partition(int[] array, int start, int end) 
  {
      int last = end - 1;
      int first = start;
      int pivot = array[start];
      while (first &lt; last)
      {
          while (first &lt; last &amp;&amp; pivot &lt;= array[last])
              last = last - 1;
          array[first] = array[last];
          while (first &lt; last &amp;&amp; pivot &gt; array[first])
              first = first + 1;
          array[last] = array[first];
      }
      array[first] = pivot;
      return first;
  }
  </code></pre>
  
  <p>and that is my quicksort function</p>
  
  <pre><code>void quickSort(int array[], int start, int end) {
        int index = partition(array, start, end);
        if (start &lt; index - 1)
              quickSort(array, start, end - 1);
        if (index &lt; end)
              quickSort(array, index, end);}
  </code></pre>
  
  <p>But when I test the code in Junit it gives me error. I need to change quickSort or partition function. What can I do with that.</p>