Question: Write a java method called interweave() which will take in two Lists, listA and listB, and returns a new List which is a combination of

Write a java method called interweave() which will take in two Lists, listA and listB, and returns a new List which is a combination of the two inputs.

Write a java method called interweave() which will take in two Lists,

Write a method called interveave which will take in two Lists, listA and listB, and returns a new List which is a combination of the two inputs. The output should be the first item of listA, then the first item of listB, then the second item of listA, then the second item of listB, and so on. If one list is bigger than the other, interweave them as much as possiblel Example inputs and outputs: [1, 3, 5, 7] and [2, 4, 6, 8] -> [1, 2, 3, 4, 5, 6, 7, 8] 12, 4, 6,8]arul 11, ,, !i. .ri > 12, 1,4,3,6,5,8,.ri ["A", "P", "Q"] and ["!", ".", "Z"] --> "A", "!", "P", ".","Q", "Z"] [1, 3, 5, 7] and [2, 4, 6, 8, 10, 12] ->[1, 2, 3, 4, 5, 6, 7, 8, 10, 121

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