Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

CSE 374: Algorithms I

Coding Homework #2 Merge sort

Grading Rubric:

1.   The program submitted for this homework must pass the necessary base case test(s) in order to qualify for earning any score at all. Programs that do not meet base case requirements will be assigned zero!

2.   The code should be well formatted and commented on. The basic requirement is the code is understandable for a person who has basic coding knowledge.

3.   There is some additional test case will be used for grading. Your code must complete it correctly and efficiently.

4.   To earn any point, you must use merge sort to finish this assignment.

Requirements:

In this part of the exercise, you will be submitting the modified starter code Solution.java via Canvas CODE plug-in.

If this is your first time using the CODE plug-in then review the submission process via the following brief video demonstration -- https://youtu.be/P2bWUt5KqbU.

Please use merge sort to sort the array L ascendingly and decreasingly, output the final result. (Sort and reverse sort the given input array using merge sort)

1.   https://www.hackerearth.com/practice/algorithms/sorting/merge-sort/visualize/

2.   https://visualgo.net/en/sorting?slide=8

Example 1:

Input: L = 12, 11, 13, 6, 5;

Output: [[5, 6, 11, 12, 13],[ 13, 12, 11, 6, 5]]

Example 2:

Input: L = 432,432,21,2,31,25,61

Output: [[2, 21, 25, 31, 61, 432, 432], [432, 432, 61, 31, 25, 21, 2]]

Example 3:

Input: L = 250, 343, 137, 789, 551, 954;

Output: [[137, 250, 343, 551, 789, 954], [954, 789, 551, 343, 250, 137]]

Example 4:

Input: L = 61,61,21,2,61,25,61

Output: [[2, 21, 25, 61, 61, 61, 61], [61, 61, 61, 61, 25, 21, 2]]