The method receives two 1D integer arrays x and y as parameters.

computer science

Description

Problem 1: 

Download the needed files and open the Interleave.java file, this file has a main method with commented code. Complete the method named interleave()to do the following: 


- The method receives two 1D integer arrays x and y as parameters. 


- The method returns a new integer array (don't alter x or y) whose first value is the first value in x, and whose 2nd value is the first value in y and whose 3rd value is the next value in x, and whose 4th value is the next value in y, etc. 


- If one array runs out, then just copy the rest of the other one into the new array. - Here are three sample runs:


Related Questions in computer science category