Question: In C + + using this code below implement the function: void order ( int decks [ ] [ SIZE ] , int numDecks, int

In C++ using this code below implement the function:
void order(int decks[][SIZE], int numDecks, int buffer[]);
Each row of decks is assumed to represent a single "deck" i.e. a list of values sorted in ascending order. Your function will populate buffer with the entire collection of values arranged in ascending order.
#include
using namespace std;
const int SIZE =4;
const int MAXDECKS =100;
void order(int decks[][SIZE], int numDecks, int buffer[]) ;
void print(int nums[], int length);
int main()
{
int decks[][SIZE]={{9,15,15,16},
{0,1,3,5},
{4,6,7,10},
{6,6,7,12},
{0,1,2,8},
{9,10,11,17},
{0,0,0,1},
{3,5,13,14}};
int buff[SIZE*8];
order(decks,8, buff);
print(buff, SIZE*8);
return 0;
}
void order(int decks[][SIZE], int numDecks, int buffer[]){
int indexes[MAXDECKS]={0}; // you may find this useful.
// Insert the code here
}
void print(int nums[], int length){
for (int i =0; i < length; i++)
cout << nums[i]<<"";
cout << endl;
}
Please explain each step. Thank you.

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!