Question: Use JAVA code and think about recursion on the lists !!! Given a list of integers a, return a new list which contains all the

Use JAVA code and think about recursion on the lists !!!

Given a list of integers a, return a new list which contains all the even elements of a. The elements should appear in the result in the same relative order as in a. Example: [2, 3, -5, 8, -2] ==> [2, 8, -2]

Use JAVA code and think about recursion on the lists !!! Given

static List evenNumbers (List a) Given a list of integers e, return a new list which contains all the even elements of a. The elements should appear in the result in the same relative order as in a. Example: [2, 3, -5, 8, -2] => [2, 8, -2]

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!