Question: C++ please Write a program that contains three functions: 1. A function that has an integer as a parameter and returns a pointer to square

C++ please

Write a program that contains three functions:

1. A function that has an integer as a parameter and returns a pointer to square array of integers (i.e. both dimensions should be equal). The function should allocate storage from the heap and randomly ll that dynamically allocated array.

2. A function that uses the algorithm described above to compute the matrix square of an array. It should be passed a pointer to an array of integers and an integer dening the dimensions of the array. It should return a double pointer to the array containing the product. This is the standard matrix-multiply algorithm that can be found throughout the web.

3. A function that uses threads to compute the matrix square of an array. This function should have the same parameters and return values of the previous function The main() function in your program needs to use these functions to compute the square of matrices with 100, 500, 1000, 5000, and 10000 integers.

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!