title: Quicksort RecursionError
body: <p>I wrote a code about Quick sort and the problem is, I get a Recursion Error for large Arrays with, for Example, over 1000 values. However, I don't have the problem with small Arrays. I don't know why I get the Error. Can someone help me?</p>
  <p>My Code:</p>
  <pre><code>last = object()
  def quicksort(array, start= 0, ende = last):
  
      if ende is last:
          ende = (len(array) -1)
  
  
      def partition(array, anfang, ende):
          piv_index = anfang
          piv = array[piv_index]
  
          while anfang &lt; ende:
              while anfang &lt; len(array) and array[anfang] &lt;= piv:
                  anfang += 1
  
              while array[ende] &gt; piv:
                  ende -= 1
  
              if anfang &lt; ende:
                  array[anfang], array[ende] = array[ende], array[anfang]
  
          array[ende], array[piv_index] = array[piv_index], array[ende]
  
          return ende
  
      if start &lt; ende:
  
          p = partition(array, start, ende)
  
          quicksort(array, start, p-1)
          quicksort(array, p+1, ende)
      return(array)
  </code></pre>