Question: PLEASE DO NOT COPY AND PASTE FROM A PREVIOUS POST. I WILL THUMBS DOWN AND REPORT YOUR ANSWER! I AM SIMPLY LOOKING FOR A DIFFERENT

PLEASE DO NOT COPY AND PASTE FROM A PREVIOUS POST. I WILL THUMBS DOWN AND REPORT YOUR ANSWER! I AM SIMPLY LOOKING FOR A DIFFERENT APPROACH. THANK YOU!

do code in java please:

Given two, sorted, integer arrays, create a new array equal to the combined size of the two arrays, containing all the values of the initial two arrays in sorted order.

Input Format

One integer n representing the size of the first array, followed by n integers: the values of the first array.

Another integer m representing the size of the second array, followed by m integers: the values of the second array.

Constraints

The values of m and n (the sizes of the two arrays to be merged) will be between 1 and 1000

The arrays will contain valid java integer values.

Output Format

display the values of the new array separated by single spaces

Sample Input 0

510 21 35 43 568 18 22 24 29 31 48 49 55

Sample Output 0

10 18 21 22 24 29 31 35 43 48 49 55 56

-----------------------------------------------------------------------------

import java.io.*; import java.util.*;

public class Solution {

public static void main(String[] args) { /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */ } }

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 Programming Questions!