Is this Quicksort correct? : <p>I changed the pivot to be the first element in the array, will this Quicksort algorithm still be ok? and will the variable "l" in the data array be the first element in all the partitioning steps?</p>

<p>x = data[l] // pivot</p>

<p>thanks</p>

<pre><code>  public void QuickSort(int[] data)
    {
        QuickSort(data, 0, data.Length - 1);

    }
    private void QuickSort(int[] data, int l, int r)
    {
        int i, j;
        int x;
        i = l;
        j = r;
        x = data[l];
        while (true)
        {
            while (data[i] &lt; x)
            {
                i++;
            }
            while (data[j] &gt; x)
            {
                j--;
            }
            if (l &lt;= j)
            {
                int temporary = data[i];
                data[i] = data[j];
                data[j] = temporary;
                i++;
                j--;
            }
            if (i &gt; j)
            {
                break;
            }
        }
        if (l &lt; j)
        {
            QuickSort(data, l, j);
        }
        if (i &lt; r)
        {
            QuickSort(data, i, r);
        }

    }
</code></pre>
