title: Printing where the last inserted array position
body: <p>I would like to print an array where it states where the "placedPosition", or the parameter's location in the array. This position is the location that the latest number was inserted into the sorted part of the array.It is the same for the "currPosition", but I can figure that out if I get help on the placed. "i" is the placedPosition, and "c" is the "currPosition". It should look something like this:</p>
  
  <p><a href="https://i.stack.imgur.com/Z3qix.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Z3qix.png" alt="enter image description here"></a></p>
  
  <p>I'm really not sure how to go about this, here is the code I have thus far:</p>
  
  <pre><code>public static void displaySort(int[] items, int currPosition, int placedPosition) {
      System.out.println("Iteration #"+currPosition);
      String[][] arr = new String[currPosition][currPosition];
      String i="i";
      String c="c";
      String ic="ic";
      System.out.println(arr[placedPosition][placedPosition]=i);
      System.out.println(arr[currPosition][currPosition]=c);
      System.out.println(Arrays.toString(items));
  }
  </code></pre>
  
  <p>Sorting:</p>
  
  <pre><code>public static void insertionSort(int[] items) {
      int currentPosition;  // the number of items sorted so far
      int currentItem;   // the value being inserted
      int backwardMovingIndex; // used to find where the current value gets inserted.
  
      //displaySort(items, 0, 0); // use this call to display the list before the first iteration (iteration 0)
  
      for (currentPosition = 1; currentPosition &lt; items.length; currentPosition++) // Start with 1 (not 0)
      {
          currentItem = items[currentPosition];
          for (backwardMovingIndex = currentPosition - 1; (backwardMovingIndex &gt;= 0) &amp;&amp; (items[backwardMovingIndex] &gt; currentItem); backwardMovingIndex--) // Larger values are moving up
          {
              items[backwardMovingIndex + 1] = items[backwardMovingIndex];
          }
          items[backwardMovingIndex + 1] = currentItem;    // Put the current value in its proper location
          displaySort(items, currentPosition, backwardMovingIndex + 1); // use this call to display the list for all other iterations
      }
  }
  </code></pre>