[ad_1]
Shift all the items from the midpoint to the right, and then add the midpoint.
If i were you i’d iterate in reverse.
for (int i = array.length - 1; i > midpoint; i--)
{
array[i] = array[i-1];
}
array[midpoint] = somenumber
[ad_2]
solved Adding a number to midpoint af an array [closed]