title: How to sort negative numbers in the quick sort algorithm?
body: <p>I am trying to use the quick sort algorithm to sort a random of list of any numbers, but do not know how to sort negative numbers as well, which part of the code should I work on?</p>
  
  <p>Didn't know what to do, commenting out the change of code will help out a lot.</p>
  
  <p>Expected Results:</p>
  
  <pre><code>&gt;&gt;&gt; quickSort([3,5,-3,-1,1,2,4])
  [-3, -1, 1, 2, 3, 4, 5]
  </code></pre>
  
  <p>Actual Results:</p>
  
  <pre><code>&gt;&gt;&gt; quickSort([3,5,-3,-1,1,2,4])
  [1, 2, -3, -1, 3, 4, 5]
  </code></pre>
  
  <pre><code>def quickSort(numList):
  
      n=len(numList)
      if n&lt;=1:
          return numList
      x, left, right = numList[0], 0, n-1
      while left&lt;right:
          if numList[left]&lt;=x:    
              left+=1
          else:
              numList[left], numList[right]  =  numList[right], numList[left]
              right -=1
      numList[0], numList[left] = numList[left], numList[0]
      quickSort(numList[:left])
      quickSort(numList[left+1:])
      return numList
  </code></pre>