|
-
November 29th, 2011, 07:27 AM
#1
[RESOLVED] Codes of this problem.....PM me
Write a program for merging two unsorted 1D double arrays in descending
order.
For example:
Input:
arr1 8 4 0 2 1
arr2 9 7 6 5 3
Output: arr3 9 8 7 6 5 4 3 2 1 0
Note: You need to define the following functions:
void inputarray(int size, double* array);
This function should prompt the user for input and hence input all array elements from the
user.
void printarray(int size, double* array);
This function should print all array elements.
void sortarray(int size, double * array, char order);
This function should sort the array which will be given as the first argument. The second
argument will be ‘A’ or ‘D’ to specify ascending or descending, respectively.
void mergeandsortarray(int size1, double* arr1, int size2, double* arr2, double* arr3);
This function should merge the sorted arrays arr1 and arr2 which will be given as the first and
second arguments. The third argument, arr3, will be the array obviously having the size of array
being the sum of the sizes of the first two arrays and will store the two arrays in merged and
ordered form. Note that your function call to this function must pass the sorted arrays arr1 and
arr2 and then simply merge them. Note that you must NOT use the naïve or simple algorithm
which would copy the two arrays into arr3 and then sort arr3!
PM me the codes !!!!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|