title: Is QuickSort able to stack overflow?
body: <p>In my code, the method will call itself (recursion). We know, a deep method call will lead to stack overflow. So, will a stack overflow happen when there is a big number of data?</p>
  
  <p>My QuickSort code: (inner class of a sort class)</p>
  
  <pre><code>private static class QuickSortor extends Sortor {
  
      protected &lt;E&gt; void sort(E[] a, boolean isAsc) {
          quickSort(a, 0, a.length - 1, isAsc);
      }
  
      private &lt;E&gt; void quickSort(E[] a, int left, int right, boolean isAsc) {
          if (left &gt;= right)
              return;
          int middle = left;
          Comparable&lt;E&gt; cmp = (Comparable&lt;E&gt;) a[left];
          for (int i = left + 1; i &lt;= right; i++) {
              int result = cmp.compareTo(a[i]);
              if (!isAsc)
                  result = -result;
              if (result &gt;= 0)
                  swap(a, ++middle, i);
          }
          swap(a, left, middle);
          quickSort(a, left, middle - 1, isAsc);
          quickSort(a, middle + 1, right, isAsc);
      }
  }
  </code></pre>