title: Straight Insertion, how to count swaps?
body: <p>This may sound stupid, but i need a confirmation. 
  For example we have an integer array:</p>
  
  <pre><code> [4 2 1 3]
  </code></pre>
  
  <p>So when the algorithm kicks in, it should work like that</p>
  
  <pre><code> 1. [2 4 1 3] 
   2. [1 2 4 3]  
   3. [1 2 3 4]
  </code></pre>
  
  <p>Can someone help me count the swaps for each step? 
  From my perspective its probably 1) 1 swap, 2) 2 swaps, 3) 1 swap. Is this correct? thanks</p>
  
  <p>Algorithm:</p>
  
  <pre><code>for(i=1; i&lt;N; i++)
  {
      x = p[i];
      j = i -1;
      while(x&lt;p[j] &amp;&amp; j&gt;=0)
      {
          p[j+1] = p[j];
          j = j-1;
      }
      p[j+1] = x;
  }
  </code></pre>