subject
Computers and Technology, 18.06.2020 15:57 keke515

Finish and test the following two functions append and merge in the skeleton file: (1) function int* append(int*,int, int*,int); which accepts two dynamic arrays and return a new array by appending the second array to the first array.
(2) function int* merge(int*,int, int*,int); which accepts two sorted arrays and returns a new merged sorted array.
#include
using namespace std;
int* append(int*,int, int*,int);
int* merge(int*,int, int*,int);
void print(int*,int);
int main()
{ int a[] = {11,33,55,77,99};
int b[] = {22,44,66,88};
print(a,5);
print(b,4);
int* c = append(a,5,b,4); // c points to the appended array=
print(c,9);
int* d = merge(a,5,b,4);
print(d,9);
}
void print(int* a, int n)
{ cout << "{" << a[0];
for (int i=1; i cout << "," << a[i];
cout << "}\n"; }
int* append(int* a, int m, int* b, int n)
{
// wru=ite your codes in the text fields
}
int* merge(int* a, int m, int* b, int n)
{
// wru=ite your codes in the text fields
}

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 16:00
Why should characters such as / \ " ' * ; - ? [ ] ( ) ~ ! $ { } < > # @ & | space, tab, and newline be avoided in file names?
Answers: 2
question
Computers and Technology, 22.06.2019 22:30
The qwerty keyboard is the most common layout of keys on a keyboard
Answers: 3
question
Computers and Technology, 23.06.2019 12:00
Which of these is an example of an integrated presentation? a. a table created in powerpoint b. an image pasted into powerpoint c. a caption created in powerpoint d. an excel chart pasted into powerpoint
Answers: 1
question
Computers and Technology, 24.06.2019 01:00
What shows the web address of the page that is currently displayed in the workspace? status window toolbar location bar internet box
Answers: 1
You know the right answer?
Finish and test the following two functions append and merge in the skeleton file: (1) function int...
Questions
question
Mathematics, 09.04.2020 17:56
question
Mathematics, 09.04.2020 17:56
Questions on the website: 13722367