Create a public class named
It should provide one class method
sort accepts an array of
Comparables and sorts them in ascending order.
You should sort the array in place, meaning that you modify the original array,
and return the number of swaps required to sort the array as an
That's how we'll know that you've correctly implemented insertion sort.
If the array is
null you should throw an
You can assume that the array does not contain any
To receive credit implement insertion sort as follows. Have the sorted part start at the left and grow to the right. Each step takes the left-most value from the unsorted part of the array and move it leftward, swapping elements until it is in the correct place. Do not swap equal values. This will make your sort unstable and cause you to fail the test suites.