Develop a program that reads two arrays from a user and sorts each array. After
ID: 3620046 • Letter: D
Question
Develop a program that reads two arrays from a user and sorts each array. After that merge the two sorted arrays into an array. Note that the merged array should also keep the sorted order properly. In this program, you must use dynamic arrays.The following shows a sample run of your program:
Enter the size of first array: 5
Enter array content: 33 11 55 66 44
Sorted result: 11 33 44 55 66
Enter the size of second array: 4
Enter array content: 22 88 54 77
Sorted result: 22 54 77 88
Combined sorted array: 11 22 33 44 54 55 66 77 88
Combined sorted array: 11 22 33 44 54 55 66 77 88
Explanation / Answer
#include using namespace std; void sort(int a[],int n) { int i,j,key; for(i=2;i0&&keyRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.