Question: in java and data language please i want the question in java language not c++ 01 [20 pts) a. 15 pts] Given an array R...he
in java and data language01 [20 pts) a. 15 pts] Given an array R...he Write and test function Boarrange to rearrange the array elements all even numbers appear before all the odd numbers in the modified array If the array was 12 10 Then after calling function Rearrange Array elements are: | 10 15 b. p pts) Given a Single linked list of integers, write and text function Rearrange to modify the linked list such that all even numbers appear before all the odd numbers in the modified linked list. Also, keep the order of even and odd numbers same Examples 1 Input: 17->15->8->12->10->S- >>->7->->NULL Output: 8->12->10->4>6>17.>1575->7>7>NULL Example 2 Input: 8->12->10->5>4>1->6->NULL Output. 8->12->10*4*6->5>1->NULL 6. [6 pts] After implementing and testing the above functions, answer the following: 1. What is the space complexity of each data structure (array and linked list)? 2. Compare the time complexity to build insert a new item at the end of the data structure, delete an item, and find an dem in each data structure 3. Which data structure would you prefer to use and why
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
