Here is an implementation of quick\_sort found in many places including [wikipedia](http://en.wikipedia.org/wiki/Quicksort). 

Here is my simple synopsis.

* Select a pivot element – ½ of left and right.
* Start index at right and iterate left.
* If Elements[right] < P pick as flip.
* Start index at left and Iterate right.
* If Elements[left] > P pick as a flip.
* Flip the two elements.
* Repeat abou the pivot point
* Repeat recursively for each half

Can someone explain the reasoning behind the two recursive lines:

```
if (left < j)quick_sort(arr, left, j);
if (i < right)quick_sort(arr, i, right);

```

Snippet:

```
  void quick_sort(int arr[], int left, int right) 
    {  
    int i = left, j = right;
    int tmp;
    int pivot = arr[(left + right) / 2];
    while (i <= j)
      {
      while (arr[i] < pivot)i++;
      while (arr[j] > pivot)j--;
      if (i <= j) 
        {
        tmp = arr[i];
        arr[i] = arr[j];
        arr[j] = tmp;
        i++;
        j--;
        }
      }
    if (left < j)quick_sort(arr, left, j);
    if (i < right)quick_sort(arr, i, right);
  }

```