Question: In given integer list that support three functions findMin, findMax, findMedian. Sort the array. public static void permutation(int [] arr, int i, int length) {
In given integer list that support three functions findMin, findMax, findMedian. Sort the array.![public static void permutation(int [] arr, int i, int length) { if](https://dsd5zvtm8ll6.cloudfront.net/images/question_images/1708/9/2/7/72365dc2aeb2e48d1708927721994.jpg)
public static void permutation(int [] arr, int i, int length) { if (length = i) { printArray(arr, length); return; } int j = i; for (j = i; j < length; j++) { swap (arr, i, j); permutation (arr, i + 1, length); swap (arr, i, j); } return; } public static void Main(string[] args) { int[] arr = new int[5]; for (int i = 0; i < 5; i++) { arr[i] = i; } permutation (arr, 0, 5);
Step by Step Solution
3.37 Rating (150 Votes )
There are 3 Steps involved in it
Algorithm Start with a function Permutationarr i length that takes three parameters the array arr th... View full answer
Get step-by-step solutions from verified subject matter experts
