Question: USING C++: The transpose of a two dimensional array is another two dimensional array where the rows of the first array become the columns of

USING C++:

The transpose of a two dimensional array is another two dimensional array where the rows of the first array become the columns of the second array (so a m by n array is transposed to a n by m array). For example:

A={ {1,2,3}, {4,5,6}};

The transpose of A will be

B ={{1,4}, {2,5}, {3,6}}

Write a function that returns the transpose of a two dimensional dynamic array of doubles. The function should take as arguments (in this order):

  • a pointer to the array (i.e., 2D dynamic array)
  • the number of rows
  • the number of columns

The function should return

  • a pointer to the new array

The function prototype is given below

 double** transpose(double**, int, int); 

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!