Question: in java 5. ( 30 points) Write a program that implements the following method (you need to call the method in vour main method). A
5. ( 30 points) Write a program that implements the following method (you need to call the method in vour main method). A method that given an array nums consisting of 2n elements in the form [x1,x2,,xn,y1,y2,,yn]. it returns the array in the form [x1,y1,x2,y2,xn,yn]. Tnputi. man =12,3,1,3,4,7l1,n=3 Output: [2,2,5,4,1,7] Inpeti nas =(1,2,3,4,4,3,2,1},n=4 betput: [1,4,2,3,3,2,4,11 Eampie 3: Inguti mes =(1,1,2,2},A=2) gutpotr [1,2,3,2]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
