Urgent required and make it easy to understand Thanks Modify your function from
ID: 3614523 • Letter: U
Question
Urgent required and make it easy to understand Thanks Modify your function from question 2 to accept as input a second array, this one of integers. The function should sort the first array as in question 2, but in addition it should return in this array of integers the original array index of the sorted values. For example, if I passed the function the array [1.2,2.3,2.1,1.7,10.7], it would return [1.2,1.7,2.1,2.3,10.7] as the sorted array, and [0,3,2,1,4] as the index array, since the first element in the sorted array, 1.2 is the first element in the original array (remember, in C the first element in an array has index 0), the second element in the sorted array, 1.7 is the fourth element in the original array, etc. To do this, your function should initially populate the index array with the integers 0, 1, 2, , n - 1. Then whenever you exchange elements in the array being sorted, make the same exchange in the index array.Explanation / Answer
Please rate #include void sel(int *p, int ten); int main (void) { int a[10]={41, 34,11, 21, 64, 45, 13, 13, 31, 62}; int i; sel(a,10); //function call printf(" Sorted numbersare: "); for(i=0;iRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.