Question: Please do and explain this in Java: (REMINDER: Please send me the complete code of the whole Part1 and Part 2!!!) and are the two
Please do and explain this in Java: (REMINDER: Please send me the complete code of the whole Part1 and Part 2!!!)







and are the two popular sorting methods in Java; behind the scene, both implements and which has an average runtime of For this lab, you are not allowed to use these two functions. Violation will deduct half of your implementation grade(-37.5\%). You need to implement a custom sorting function that can take in any date type and sort them(Generic type). Your will use for the sorting portion of the lab Part 1: - Follow the pseudocode and instructions in the starter code, complete the logics for the function. The is slightly different from the class slides, it uses But the main logic is the same. Part 2: - Given an unsorted array of distinct integers , sort the array by using quick sort from Part 1, then find all nairs of elements with the minimum absolute difference of any two ele - Return a list of pairs in ascending order(with respect to pairs), each pair follows: from , and equals to the minimum absolute difference of any two elements in Examples Input: arr =[5,4,2,1,3] Output: [[1,2],[2,3],[3,4],[4,5]] Explanation: The minimum absolute difference is 1. List all pairs with difference equal to 1 in ascending order. Input: arr =[1,3,6,10,15] Output: [[1,3]] Explanation: The minimum absolute difference is 2. Input: arr =[4,8,12,21,17,1,16,25] Output: [[16,12],[4,8],[17,21],[21,25]] Explanation: The minimum absolute difference is 4. Requirements - You must submit a single Java file containing the class named Lab04. Your class must contain the functions with the following headers: public static List minimumAbsDifference(int[] arr) - You must also complete your sorting functionality and include all related functions. public static
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
