Question: Problem 1 (68 points): Write a program to sort an array of integers via arrays of pointers to those integers as shown in the figure.

Problem 1 (68 points): Write a program to sort an array of integers via arrays of pointers to those integers as shown in the figure. The code should contain the following functions: 1) to randomly generate an array of integer numbers; 2) to allocate memory and build the arrays of pointers as shown in the figure (two such arrays are required); 3) to sort one of the arrays of pointers to point to the integer numbers in ascending order (must use recursive selection sort from Homework 4); 4) to sort one of the arrays of pointers to point to the integer numbers in descending order (must use recursive insertion sort from Homework 4); 5) to print the array of integers as shown in the bottom figure. Implement pass by reference and pass by value as appropriate. 26 14 57 57 Ascending BEFORE SORTING AFTER SORTING 14 26 Descending 57 41 57 41 26 14
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
