1 short recursion practice write a method in the recursiontester class called sort 5346820

(1) Short Recursion Practice

Write a method in the RecursionTester class called sort(int[] v)which takes an integer array and

sorts the array in increasing order. Note that the method shouldsort the array given, not create any new

arrays. Also, you MUST write the method recursively to get anymarks. You will want to use a helper

method. (Hint: Move left to right through the array recursively,swapping a pair of elements if the one on the left is larger

than the one on the right. Use a parameter to keep track of theposition of the element pair that you are examining. If you

reach the end of the array and no items have been swapped, then thearray is sorted now and you can stop. Otherwise, you

will need to restart the swapping process from the beginning of thearray. You'll need to keep track of whether or not you

made a swap…use another parameter). It may be helpful to write amethod that will display your array, so that

you can use this for debugging. Here is an example of how to testit from a main method, assuming that

you have a method called displayArray to display the array:

int[] v = {3, 6, 9, 2, 7, 1, 5, 8, 4, 2, 2, 1};



"Get 15% discount on your first 3 orders with us"
Use the following coupon

Order Now