title: InsertionSort mistake
body: <p>I need help to understand my mistake. I'm trying to make the insertion sort but it doesn't work.</p>
  
  <pre><code>void insertionSort(int A[]) {
      int temp, j, d;
  
      for (int i = 1; i &lt;= dim - 1; i++) {
          j = i;
          while (d &gt; 0 &amp;&amp; A[d-1] &gt; A[d]) {
              temp = A[j];
              A[j] = A[j - 1];
              A[j - 1] = temp;
          }
      }
  }
  </code></pre>