Question
Please check my code. Why am I getting RUN FAILED error from inputting 5 or 6? ========C++ CODE======== #include //I/O Library using namespace std; int
Please check my code. Why am I getting RUN FAILED error from inputting 5 or 6?
========C++ CODE======== #include
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; }
int **fillAry(int *col,int rows){ int **array=new int*[rows]; for(int i=0;i 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;pos 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 Input the Number of Rows in the Array 5 The Column Array Size 3 4 1 8 2 The Triangular Array Sorted 3 5 4 6 2 5 7 9 9 4 9 8 2 3 9 9 4 1 RUN FAILED (exit value 1, total time: 35)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started