title: c# quicksort algorithm doesnt proceed
body: <p>I have just worked on implementation of quicksort in c# but then I have faced a such a problem. When I am using my function</p>
  
  <pre><code>static void QS(int[] arr, int left, int right){
          int pivot = left;
          int temp;
          int i = left + 1;
          int j = left + 1;
  
          do {    
          if (arr [i] &lt; arr [pivot]) {
                  temp = arr [j];
                  arr [j] = arr [i];
                  arr [i] = temp;
                  i++;
              }
              else{}
          j++;
          }while(j&lt;=right);
  
              temp = arr [pivot];
              arr [pivot] = arr [i - 1];
              arr [i - 1] = temp;
  } 
  </code></pre>
  
  <p>For an array </p>
  
  <pre><code>int[] arr = { 12, 9, 19, 8, 7, 13, 10, 71, 18, 34, 90, 15, 3 };
  </code></pre>
  
  <p>I get the results like this: 
  <code>9, 12, 19, 8, 7, 13, 10, 71, 18, 34, 90, 15, 3</code>. 
  Hours been spent on this I still can't quite understand <strong>why index i does not proceed</strong>. Maybe there are more problems than I think.</p>
  
  <p>I omitted recursive calls to concentrate on fuction itself. I am using this pseudo-code:   </p>
  
  <pre><code>Partiton(A,l,r)  
  //[input corresponds to A[l…r]]  
  p:=A[l]  
  i:=l+1  
    for  
     j=l+1 to r  
      if A[j] &lt; p  
      swap A[j] and A[i]  
      i:=i+1  
  swap  A[l] and A[i‐1]
  </code></pre>