title: Difference in Space Complexity of different sorting algorithms
body: <p>I am trying to understand Space Complexities of different sorting algorithms.</p>
  
  <p><a href="http://bigocheatsheet.com/?goback=.gde_98713_member_241501229" rel="nofollow">http://bigocheatsheet.com/?goback=.gde_98713_member_241501229</a>
  <br />from the above link I found that the complexity of
  bubble sort,insertion and selection sort  is O(1)<br/>
  where as quick sort is O(log(n)) and merge sort is O(n).</p>
  
  <p>we were actually not allocating extra memory in any of the algorithms.
  Then why the space complexities are different when we are using the same array to sort them?</p>