title: Quicksort with first element as pivot example
body: <p>I am currently studying quicksort and would like to know how it works when the first (or last) element is chosen as the pivot point.</p>
  
  <p>Say for example I have the following array:</p>
  
  <pre><code>{15, 19, 34, 41, 27, 13, 9, 11, 44}
  </code></pre>
  
  <p>This is what I think happens:</p>
  
  <pre><code>{15, 19, 34, 41, 27, 13, 9, 11, 44}
   ^
  pivot
  
  {15, 19, 34, 41, 27, 13, 9, 11, 44}
   ^                              ^
  compare these two, they are good
  
  {15, 19, 34, 41, 27, 13, 9, 11, 44}
   ^                          ^
  compare these two and swap
  
  {11, 19, 34, 41, 27, 13, 9, 15, 44}
   ^                       ^
  compare these two and swap
  
  {9, 19, 34, 41, 27, 13, 11, 15, 44}
   ^                  ^
  compare these two, they are good
  
  {9, 19, 34, 41, 27, 13, 11, 15, 44}
   ^              ^
   compare these two, they are good
  
  {9, 19, 34, 41, 27, 13, 11, 15, 44}
   ^          ^
  compare these two, they are good
  
  {9, 19, 34, 41, 27, 13, 11, 15, 44}
   ^      ^
   compare these two, they are good
  
  {9, 19, 34, 41, 27, 13, 11, 15, 44}
   ^  ^
   compare these two, they are good
  
  {9, 19, 34, 41, 27, 13, 11, 15, 44}
  
  End of first partition
  </code></pre>
  
  <p>Is this how it works? If so, would 19 be the new pivot point, or do you divide the array in half to find it (so that it would be 27/13), or does it depend on the implementation of the quicksort? Thanks for your time!</p>