Question: Create an Ordered Triangular Matrix (C++) Take the template and complete creation and ordering of the Triangular Matrix. //Complete the following Functions int**fillAry(int *,int); //Randomly

Create an Ordered Triangular Matrix (C++)

Take the template and complete creation and ordering of the Triangular Matrix.

//Complete the following Functions

int**fillAry(int *,int); //Randomly fill a triangular array

void prntAry(int **,int *,int *,int);//Print a triangular array

-------------------------------------------------------------------------------------------------------------

//System Libraries Here #include //I/O Library using namespace std;

//User Libraries Here

//Global Constants Only, No Global Variables //Like PI, e, Gravity, or conversions

//Function Prototypes Here int mrkRand(int=1

//Program Execution Begins Here int main(int argc, char** argv) { //Declare all Variables Here int *col; //Pointer to column array int *indx; //Index Array to the Sort Routine int **trangl; //Pointer to triangular array int rowSize; //Number of Rows in the Array //Input or initialize values Here cout>rowSize; indx=fillIdx(rowSize); //Index used for Database Sort col=fillAry(rowSize); //Dynamic 1-D array,#Columns in each row trangl=fillAry(col,rowSize);//Dynamic triangular array //Output Located Here cout

//Deallocate the array destroy(trangl,col,indx,rowSize); //Exit return 0; }

//Modify this Function for unequal number of columns per row //Input rows -> Number of rows // col -> Column array size n with number of columns in each row //Output // array -> 2D Triangular Array/Matrix int **fillAry(int *col,int rows){ int **array=new int*[rows]; for(int i=0;i

//Modify this Function for unequal number of columns per row //Input n -> Number of rows // col -> Column array size n with number of columns in each row // array -> 2D Triangular Array/Matrix void prntAry(int **array,int *col,int *indx,int rows){ for(int i=0;i

void mrkSort(int *array,int *indx,int size){ for(int pos=0;posarray[indx[lst]]){ indx[pos]=indx[pos]^indx[lst]; indx[lst]=indx[pos]^indx[lst]; indx[pos]=indx[pos]^indx[lst]; } } } }

void destroy(int **a,int *c,int *indx,int n){ //Delete every row of the triangular array for(int i=0;i

void prntAry(int *a,int n){ for(int i=0;i

int *fillAry(int n){ int *array=new int[n]; for(int i=0;i

int *fillIdx(int n){ int *array=new int[n]; for(int i=0;i

int mrkRand(int seed){ //Xn+1 = (aXn + c) mod m //where X is the sequence of pseudo-random values //m, 0

---------------Expected output-----------------

Create an Ordered Triangular Matrix (C++) Take the template and complete creation

--------------------

please show the whole modified code

(MUST MATCH EXACTLY THE EXPECTED OUTPUT) thank you

Expected Output Input-theNumber of.Rows.in.the. Array- The Column ArraySize- 3.4.1.8.2-6.2.5.7.9.- The Triangular. Array.Sorted- : 9 3.2.w 9.3.4 9.4 3.4 9.8.2-3.4 7.1.4.4.9. 3.9.2.4.5.4 3.5.8.3.8.6.7.- 9.4.1.5.4.7.9.7. 5.5.6.2-4.7-6.6.1.4

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!