Need help with this program in java
Using pen and paper, write out the contents of the array after each pass of the insertion sort algorithm for the following arrays:
int[] arr1 = {14, 28, 17, 74, 32, 16, 5, 9, 41}
int[] arr2 = {2, 14, 17, 23, 31, 36, 42, 47, 49}
int[] arr3 = {97, 81, 74, 68, 62, 54, 50, 41, 13}
Implement the insertion sort algorithm in Java and write out the state of the array after each pass.
Use your implementation to check your pen and paper work.
example code:
int[] exampleArr = {5, 91, 19, 7, 46, 2, 8, 29, 14};
insertionSort(exampleArr);