Question: Using c ++ code Please answer quickly Thanks for your efforts The following is the selection sort function. The function sorts an array of integers

 Using c ++ code Please answer quickly Thanks for your efforts

Using c ++ code Please answer quickly Thanks for your efforts

The following is the selection sort function. The function sorts an array of integers of any size in ascending order. void sort(int A[], int size) { for(int i=0; iA[3]) { int t=A[i]; A[i]=A[j]; A[j]=t; } } } a- Rewrite the function above so that it sorts the array by moving pointers. Use two pointers to move through the array cells (do not use index notation A[i] or *(A+)). b- Test your function: Call your function to sort one-dimensional arrays if integers of your choice and make sure it works properly. C- After testing your function on one-dimensional arrays, write another function that accepts a two-dimensional array as parameter and calls your function in part (a) to sort every row of the matrix. The function header is given below. void SortMatrixRows(int B[][20], int rows) { d- Test your code by calling the function in part (c) on a matrix of integers entered by the user and display the result on screen (row-wise)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!