I need to sort arrays of varying sizes. These sizes are: 10 elements, 50 elements, 100 elements, 500 elements, and 1000 elements. For each of these array sizes, I should use one array that is already sorted, another array that is partially sorted, and one that is random. I should use three sorts, like quicksort, insertion, or bubblesort. I have been working this for 2 weeks but can not seem to create an call the arrays.
Share
Here are some utility methods to create test arrays and to verify if your sorting method is working fine:
Note – the
fromandtoparameters have to be in the range[0..size-1]withfrom < to.Here’s fragment that you can use to create your arrays, feed them into your sorter and verify the results: