Can use a for for the counter and eliminate a lot of the counters
public static void insertionSort(int[] unsortedArray)
{
int unsortedElementlastIndex = unsortedArray.[unsortedArray.Count()Length - 1];1;
for (int iunsortedElement = unsortedArray.Count[lastIndex ];
for ()int -i 1;= lastIndex; i >= 0; i--)
{
if (i == 0)
{
unsortedArray[i] = unsortedElement;
printArray(unsortedArray);
}
else if(unsortedArray[i - 1] > unsortedElement)
{
unsortedArray[i] = unsortedArray[i - 1];
printArray(unsortedArray);
}
else
{
unsortedArray[i] = unsortedElement;
printArray(unsortedArray);
break;
}
}
}