Question: 1. (15 minutes) (15 points) Write a method named paste, which takes two arrays A and B and an integer value k as its parameters,
1. (15 minutes) (15 points) Write a method named paste, which takes two arrays A and B and an integer value k as its parameters, and returns a new array which inserts the array 8 at position k in the array A and returns the resulting array. Example 1: A =(2,4,5,7,8) B ={8,10,12) k = 1 Method should return{2,8,10,12,4,5,7,8) Example 2: A ={3,4,8,9), B ={7,10,12,20,24) k = 0. Method should return{7,10,12,20,24,3,4,8,9)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
